PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: sanic-org/sanic-ext (python)

Issue:
[Bug] Sanic-ext breaks @app.route(unquote=True)
**Describe the bug**
Sanic v21.3 adds [the `unquote` arg in `@app.route`](https://sanic.dev/en/guide/release-notes/v21.3.html#unquote-in-route) to url-decode parameters in routes. But when sanic-ext is loaded, parameters will not be decoded even `unquote` is set.

**Screenshots**
Not related to swagger.

**To Reproduce**
```python
from sanic import Sanic
from sanic.response import text

app = Sanic("test")
#app.config.AUTO_EXTEND = False

@app.route("/<param:str>", methods=["GET"], unquote=True)
async def handler2(request, param):
    return text("OK2 " + param)
```

Then visit `http://127.0.0.1:8000/%E5%95%8A` and find that it returns `OK2 %E5%95%8A`.

**Expected behavior**
The page should return `OK2 啊`.

**Environment (please complete the following information):**
 - OS: Windows 10
 - Browser: not related
 - Version sanic==22.9.0, sanic-ext==22.9.0

**Additional context**
After uncommenting `app.config.AUTO_EXTEND = False` in the script above, sanic works as expected. So this issue is caused by sanic-ext.

Pull request:
Pass unquote thru add_route
Closes #148 
Requires https://github.com/sanic-org/sanic/pull/2639

Patch:
diff --git a/sanic_ext/extensions/http/methods.py b/sanic_ext/extensions/http/methods.py
index 756411d..176167d 100644
--- a/sanic_ext/extensions/http/methods.py
+++ b/sanic_ext/extensions/http/methods.py
@@ -92,6 +92,7 @@ def add_auto_handlers(
                                 strict_slashes=group.strict,
                                 name=name,
                                 host=host,
+                                unquote=group.unquote,
                             )
             app.finalize()
 
@@ -138,5 +139,6 @@ def add_auto_handlers(
                             strict_slashes=group.strict,
                             name=name,
                             host=host,
+                            unquote=group.unquote,
                         )
             app.finalize()


Test patch:
diff --git a/tests/extensions/http/test_methods.py b/tests/extensions/http/test_methods.py
index faf27d0..7d8e207 100644
--- a/tests/extensions/http/test_methods.py
+++ b/tests/extensions/http/test_methods.py
@@ -1,3 +1,4 @@
+import pytest
 from sanic import Sanic
 from sanic.response import empty, text
 
@@ -85,3 +86,20 @@ def test_auto_head_with_vhosts(app: Sanic, get_docs):
 
     schema = get_docs()
     assert "get" in schema["paths"]["/foo"]
+
+
+# This test also appears in Core Sanic tests but is added here as well
+# because of: https://github.com/sanic-org/sanic-ext/issues/148
+@pytest.mark.parametrize("unquote", [True, False, None])
+def test_unquote_add_route(app, unquote):
+    async def handler1(_, foo):
+        return text(foo)
+
+    app.add_route(handler1, "/<foo>", unquote=unquote)
+    value = "啊" if unquote else r"%E5%95%8A"
+
+    _, response = app.test_client.get("/啊")
+    assert response.text == value
+
+    _, response = app.test_client.get(r"/%E5%95%8A")
+    assert response.text == value
Repository: hustcc/jest-canvas-mock (js)

Issue:
Running tests in node environment
I have `jest-canvas-mock` configured in my package.json:
```
"jest": {
  "setupFiles": [
    "jest-canvas-mock"
  ]
}
```

This is working great for my tests 🎉 

However, I'm running some new tests in the [node test environment](https://facebook.github.io/jest/docs/en/configuration.html#testenvironment-string) by using the docblock at the top of the file. In this case `jest-canvas-mock` is throwing an error that window is not defined (which is expected I guess)

Is there any way that the canvas mock can be disabled for jest test files that are run in the node environment?

Pull request:
fix(ssr): allow mocking to fail silently in node env
Fixes #6

Allows `jest-canvas-mock` to run normally in jsdom environments.

Allows the mocking to fail silently in node environments, which is needed to test components that are rendered both on the client and on the server.

Patch:
diff --git a/lib/index.js b/lib/index.js
index ee1f36d..5a778e0 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -7,7 +7,9 @@ var _window2 = _interopRequireDefault(_window);
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 // mock global window
-global.window = (0, _window2.default)(window); /**
-                                                * Created by hustcc 17/12/25.
-                                                * Contract: i@hust.cc
-                                                */
\ No newline at end of file
+if (typeof window !== 'undefined') {
+  global.window = (0, _window2.default)(window);
+} /**
+   * Created by hustcc 17/12/25.
+   * Contract: i@hust.cc
+   */
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index b68d6e5..3308e73 100644
--- a/src/index.js
+++ b/src/index.js
@@ -6,4 +6,6 @@
 import mockWindow  from './window';
 
 // mock global window
-global.window = mockWindow(window);
+if (typeof window !== 'undefined') {
+  global.window = mockWindow(window);
+}


Test patch:
diff --git a/__tests__/server-side.js b/__tests__/server-side.js
new file mode 100644
index 0000000..f6df8ee
--- /dev/null
+++ b/__tests__/server-side.js
@@ -0,0 +1,15 @@
+/**
+ * @jest-environment node
+ */
+
+/**
+ * test canvas mock in a node environment
+ */
+
+import createCanvas from '../src/canvas';
+
+describe('canvas', () => {
+  test('running in node environment fails silently', () => {
+    expect(createCanvas).toBeDefined();
+  })
+});
\ No newline at end of file