PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: delvedor/find-my-way (js)

Issue:
TypeError: currentNode.createStaticChild is not a function for wildcard route
Hi,

Let's say I have the following code:
```js
const http = require("http");
const router = require("find-my-way")();

router.on("GET", "*.js", (req, res, params) => {
  res.end(`{"route":"${req.url}"}`);
});

const server = http.createServer((req, res) => {
  router.lookup(req, res);
});

server.listen(3000, (err) => {
  if (err) throw err;
  console.log("Server listening on: http://localhost:3000");
});
```

With find-my-way@4.5.1 (that is included in fastify@3.29.2) the code above works fine and I can run `curl http://localhost:3000/assets/hello.js` and get back `{"route":"/assets/hello.js"}` but with `find-my-way@7.2.0` (that is included in fastify@4.6.0) I get:

```
TypeError: currentNode.createStaticChild is not a function
    at Router._on (node_modules/find-my-way/index.js:190:33)
    at Router.on (node_modules/find-my-way/index.js:136:10)
    at Object.<anonymous> (server.cjs:20:8)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47
```

I guess this is a bug? Or is it a better way to get all requests that request for a javascript file?

Pull request:
Add error for wildcard route with suffix
Close #304 https://github.com/fastify/fastify/issues/4306

Patch:
diff --git a/index.js b/index.js
index 32fd008..551c2cc 100644
--- a/index.js
+++ b/index.js
@@ -267,6 +267,10 @@ Router.prototype._on = function _on (method, path, opts, handler, store) {
       params.push('*')
       currentNode = currentNode.createWildcardChild()
       parentNodePathIndex = i + 1
+
+      if (i !== path.length - 1) {
+        throw new Error('Wildcard must be the last character in the route')
+      }
     }
   }
 


Test patch:
diff --git a/test/issue-28.test.js b/test/issue-28.test.js
index fb901e6..c25d3ef 100644
--- a/test/issue-28.test.js
+++ b/test/issue-28.test.js
@@ -601,3 +601,19 @@ test('Wildcard node with constraints', t => {
     null
   )
 })
+
+test('Wildcard must be the last character in the route', (t) => {
+  t.plan(6)
+
+  const expectedError = new Error('Wildcard must be the last character in the route')
+
+  const findMyWay = FindMyWay()
+
+  t.throws(() => findMyWay.on('GET', '*1', () => {}), expectedError)
+  t.throws(() => findMyWay.on('GET', '*/', () => {}), expectedError)
+  t.throws(() => findMyWay.on('GET', '*?', () => {}), expectedError)
+
+  t.throws(() => findMyWay.on('GET', '/foo*123', () => {}), expectedError)
+  t.throws(() => findMyWay.on('GET', '/foo*?', () => {}), expectedError)
+  t.throws(() => findMyWay.on('GET', '/foo*/', () => {}), expectedError)
+})
Repository: domluna/JuliaFormatter.jl (julia)

Issue:
Error formatting nested for...in
I am running into a bug that causes the formatter to error on nested `for..in` calls. Here is a minimal example that causes an error:

```
x = [[1,2,3], [4,5,6]]
print([z for y in x for z in y])
```

Let me know if there is a way to fix this, I'm not sure what the best approach would be. The following code works with the formatter, but doesn't produce the appropriate list and instead produces generators:

```
x = [[1,2,3], [4,5,6]]

print([(z for z in y) for y in x])
```

Pull request:
fix #419 

verifies the latter part of a generator expression does not contain a FOR keyword before assuming it's a tuple expression

Patch:
diff --git a/Project.toml b/Project.toml
index adc4c4051..3d16ac011 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "JuliaFormatter"
 uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
 authors = ["Dominique Luna <dluna132@gmail.com>"]
-version = "0.14.5"
+version = "0.14.6"
 
 [deps]
 CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
diff --git a/src/styles/yas/pretty.jl b/src/styles/yas/pretty.jl
index 675957397..85860e8e4 100644
--- a/src/styles/yas/pretty.jl
+++ b/src/styles/yas/pretty.jl
@@ -337,8 +337,13 @@ function p_generator(ys::YASStyle, cst::CSTParser.EXPR, s::State)
                 for j = i+1:length(cst)
                     push!(tupargs, cst[j])
                 end
+
+                # verify this is not another for loop
+                any(b -> b.head === :FOR, tupargs) && continue
+
                 tup = p_tuple(style, tupargs, s)
                 add_node!(t, tup, s, join_lines = true)
+
                 if has_for_kw
                     for nn in tup.nodes
                         eq_to_in_normalization!(nn, s.opts.always_for_in)
@@ -366,7 +371,7 @@ function p_filter(ys::YASStyle, cst::CSTParser.EXPR, s::State)
 end
 
 function p_flatten(ys::YASStyle, cst::CSTParser.EXPR, s::State)
-    p_generator(ys, cst, s)
+    t = p_generator(ys, cst, s)
     t.typ = Flatten
     t
 end


Test patch:
diff --git a/test/issues.jl b/test/issues.jl
index 1da3e370c..4395f28f0 100644
--- a/test/issues.jl
+++ b/test/issues.jl
@@ -737,4 +737,27 @@
         """
         @test fmt(str) == str
     end
+
+    @testset "issue 419" begin
+        str = """
+        [z for y in x for z in y]
+        """
+        @test yasfmt(str) == str
+        @test yasfmt(str, margin = 25) == str
+
+        str_ = """
+        [z
+         for y in x for z in y]
+        """
+        @test yasfmt(str_, margin = 24) == str
+
+        str_ = """
+        [z
+         for y in
+             x
+         for z in
+             y]
+        """
+        @test yasfmt(str_, margin = 1) == str
+    end
 end
Repository: liampauling/flumine (python)

Issue:
backtesting: market_book not updating on market.closed = True
```python
for market in framework.markets:
    results = {r.selection_id: r.status for r in market.market_book.runners}
    print(results)

{38432986: 'ACTIVE', 28095515: 'REMOVED', 38235043: 'ACTIVE', 26817710: 'ACTIVE', 36775362: 'ACTIVE', 37487570: 'ACTIVE', 27207443: 'ACTIVE', 10138440: 'ACTIVE', 38648845: 'ACTIVE', 14037512: 'ACTIVE', 36753881: 'ACTIVE', 12829452: 'ACTIVE', 24075586: 'ACTIVE'}
```
   
https://github.com/liampauling/flumine/blob/ec060b7d98a9f15ec229fab73644d5ad970e05fe/flumine/backtest/backtest.py#L118


Pull request:
close #499
add missingmarket call on closure

Patch:
diff --git a/HISTORY.rst b/HISTORY.rst
index b1f5f8f..bf3b6ab 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -10,6 +10,10 @@ Release History
 
 - Update to use `listener_kwargs` in `_process` rather than `snap`
 
+**Bug Fixes**
+
+- #499 missing market call on closure
+
 **Libraries**
 
 - betfairlightweight upgraded to 2.14.0
diff --git a/flumine/baseflumine.py b/flumine/baseflumine.py
index ab744ee..f8e3f5f 100644
--- a/flumine/baseflumine.py
+++ b/flumine/baseflumine.py
@@ -272,6 +272,8 @@ class BaseFlumine:
                 extra={"market_id": market_id, **self.info},
             )
             return
+        # process market
+        market(market_book)
         if market.closed is False:
             market.close_market()
         if recorder is False:


Test patch:
diff --git a/tests/test_baseflumine.py b/tests/test_baseflumine.py
index a803088..f77b701 100644
--- a/tests/test_baseflumine.py
+++ b/tests/test_baseflumine.py
@@ -234,6 +234,7 @@ class BaseFlumineTest(unittest.TestCase):
             mock_market, mock_market_book
         )
         mock_log_control.assert_called_with(mock_event)
+        mock_market.assert_called_with(mock_market_book)
 
     @mock.patch("flumine.baseflumine.BaseFlumine.info")
     @mock.patch("flumine.baseflumine.BaseFlumine.log_control")