PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: asottile/add-trailing-comma (python)

Issue:
`AssertionError: Past end?` on match statement class with no args
Interpreter: Python 3.10

Minimum breaking example:

```python
match 1:
    case str():  # `str()` seems to be important here!
        pass
    case _:
        pass
```

Probably related to #177 .

Pull request:
skip fixing MatchClass with no args
resolves #181 

Patch:
diff --git a/add_trailing_comma/_plugins/match.py b/add_trailing_comma/_plugins/match.py
index 5ae804c..e0a30a9 100644
--- a/add_trailing_comma/_plugins/match.py
+++ b/add_trailing_comma/_plugins/match.py
@@ -38,8 +38,9 @@ if sys.version_info >= (3, 10):  # pragma: >=3.10 cover
     ) -> Iterable[tuple[Offset, TokenFunc]]:
         arg_offsets = {ast_to_offset(pat) for pat in node.patterns}
         arg_offsets |= {ast_to_offset(pat) for pat in node.kwd_patterns}
-        func = functools.partial(_fix_match_class, arg_offsets=arg_offsets)
-        yield ast_to_offset(node), func
+        if arg_offsets:  # can't add commas without args!
+            func = functools.partial(_fix_match_class, arg_offsets=arg_offsets)
+            yield ast_to_offset(node), func
 
     def _fix_mapping(i: int, tokens: list[Token]) -> None:
         fix_brace(


Test patch:
diff --git a/tests/features/match_test.py b/tests/features/match_test.py
index ed9b691..30b13d9 100644
--- a/tests/features/match_test.py
+++ b/tests/features/match_test.py
@@ -16,6 +16,12 @@ from add_trailing_comma._main import _fix_src
             '        pass\n',
             id='sequence without braces',
         ),
+        pytest.param(
+            'match x:\n'
+            '    case a():\n'
+            '        pass\n',
+            id='class without args',
+        ),
     ),
 )
 def test_noop(s):
Repository: MiSawa/xq (rust)

Issue:
Cannot use null and booleans in object value
I noticed that I can't use some values in in object value.
```sh
❯ xq -n '{x: null}'
Error: compile query

Caused by:
    CompileError(UnknownFunction(Identifier("null"), 0))

❯ xq -n '{x: true}'
Error: compile query

Caused by:
    CompileError(UnknownFunction(Identifier("true"), 0))

❯ xq -n '{x: false}'
Error: compile query

Caused by:
    CompileError(UnknownFunction(Identifier("false"), 0))

❯ xq --version
xq 0.2.3-a7d4cfbf962f3570b326dd97ecf288365d396ed4
```

Pull request:
Fix object keyword
Fix #67 

Patch:
diff --git a/README.md b/README.md
index 5851a43..79410a4 100644
--- a/README.md
+++ b/README.md
@@ -81,6 +81,7 @@ $ cargo set-version --bump patch    # or just edit Cargo.toml to bump the versio
 $ cargo build                       # to generate Cargo.lock
 $ git commit -am "Bump version"     # so that there's no uncommited changes
 $ git tag v0.2.x                    # just in case...
+$ git push
 $ git push --tags
 $ cargo publish
 ```
diff --git a/src/lang/lexer.rs b/src/lang/lexer.rs
index 2e0ec5b..ad6c2fb 100644
--- a/src/lang/lexer.rs
+++ b/src/lang/lexer.rs
@@ -491,9 +491,6 @@ lexer! {
         "as"      => |lexer| handle_keyword!(lexer, Keyword::As),
         "label"   => |lexer| handle_keyword!(lexer, Keyword::Label),
         "break"   => |lexer| handle_keyword!(lexer, Keyword::Break),
-        "null"    => |lexer| handle_keyword!(lexer, Keyword::Null),
-        "false"   => |lexer| handle_keyword!(lexer, Keyword::False),
-        "true"    => |lexer| handle_keyword!(lexer, Keyword::True),
         "if"      => |lexer| handle_keyword!(lexer, Keyword::If),
         "then"    => |lexer| handle_keyword!(lexer, Keyword::Then),
         "elif"    => |lexer| handle_keyword!(lexer, Keyword::Elif),
@@ -504,6 +501,13 @@ lexer! {
         "reduce"  => |lexer| handle_keyword!(lexer, Keyword::Reduce),
         "foreach" => |lexer| handle_keyword!(lexer, Keyword::Foreach),
 
+        // These three keywords can be in a value of an object entry.
+        // Since we don't care this in the post processing anyway,
+        // we always treat them as a keyword.
+        "null"    = Token::Keyword(Keyword::Null),
+        "false"   = Token::Keyword(Keyword::False),
+        "true"    = Token::Keyword(Keyword::True),
+
         '.' $ident_start $ident_follow* => |lexer| {
             lexer.return_(Token::Field(&lexer.match_()[1..]))
         },


Test patch:
diff --git a/tests/hand_written/mod.rs b/tests/hand_written/mod.rs
index 2be4b5f..c3ceb3b 100644
--- a/tests/hand_written/mod.rs
+++ b/tests/hand_written/mod.rs
@@ -347,3 +347,16 @@ test!(
     [1,2]
     "#
 );
+
+test!(
+    keyword_in_object,
+    r#"
+    {x: null, y: true, z: false, true: 1, false: 2, null: 3, try: 4, else: 5}
+    "#,
+    r#"
+    null
+    "#,
+    r#"
+    {"x": null, "y": true, "z": false, "true": 1, "false": 2, "null": 3, "try": 4, "else": 5}
+    "#
+);
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 173
Good morning! Here's your coding interview problem for today.

This problem was asked by Stripe.

Write a function to flatten a nested dictionary. Namespace the keys with a period.

For example, given the following dictionary:
```
{
    "key": 3,
    "foo": {
        "a": 5,
        "bar": {
            "baz": 8
        }
    }
}
```
it should become:
```
{
    "key": 3,
    "foo.a": 5,
    "foo.bar.baz": 8
}
```

Pull request:
Day173
Resolves #360.

Patch:
diff --git a/README.md b/README.md
index 7186829..1f804ba 100644
--- a/README.md
+++ b/README.md
@@ -184,3 +184,4 @@ problems from
 * [Day 170](https://github.com/vaskoz/dailycodingproblem-go/issues/353)
 * [Day 171](https://github.com/vaskoz/dailycodingproblem-go/issues/356)
 * [Day 172](https://github.com/vaskoz/dailycodingproblem-go/issues/358)
+* [Day 173](https://github.com/vaskoz/dailycodingproblem-go/issues/360)
diff --git a/day173/problem.go b/day173/problem.go
new file mode 100644
index 0000000..ad92a6b
--- /dev/null
+++ b/day173/problem.go
@@ -0,0 +1,21 @@
+package day173
+
+import "strings"
+
+// FlattenMap takes an arbitrary map and flattens it.
+// It concatenates keys with '.'
+func FlattenMap(m map[string]interface{}) map[string]interface{} {
+	result := make(map[string]interface{})
+	dfsFlattenMap([]string{}, m, result)
+	return result
+}
+
+func dfsFlattenMap(prefix []string, m, result map[string]interface{}) {
+	for k, v := range m {
+		if obj, ok := v.(map[string]interface{}); ok {
+			dfsFlattenMap(append(prefix, k), obj, result)
+		} else {
+			result[strings.Join(append(prefix, k), ".")] = v
+		}
+	}
+}


Test patch:
diff --git a/day173/problem_test.go b/day173/problem_test.go
new file mode 100644
index 0000000..9815a9f
--- /dev/null
+++ b/day173/problem_test.go
@@ -0,0 +1,42 @@
+package day173
+
+import (
+	"reflect"
+	"testing"
+)
+
+var testcases = []struct {
+	nested, flattened map[string]interface{}
+}{
+	{map[string]interface{}{
+		"key": 3,
+		"foo": map[string]interface{}{
+			"a": 5,
+			"bar": map[string]interface{}{
+				"baz": 8,
+			},
+		},
+	},
+		map[string]interface{}{
+			"key":         3,
+			"foo.a":       5,
+			"foo.bar.baz": 8,
+		}},
+}
+
+func TestFlattenMap(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := FlattenMap(tc.nested); !reflect.DeepEqual(result, tc.flattened) {
+			t.Errorf("Expected %v got %v", tc.flattened, result)
+		}
+	}
+}
+
+func BenchmarkFlattenMap(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			FlattenMap(tc.nested)
+		}
+	}
+}
Repository: boardgameio/boardgame.io (ts)

Issue:
playerView executed twice for multiplayer game
When using playerView to calculate results from secret info, boardgame.io crashes.

Here is a minimal reproduce.
https://codesandbox.io/s/boardgameio-typescript-player-view-issue-demo-f-hefjq?file=/src/Game.ts

Pull request:
fix(client): Fix playerView executed twice do not strip again if is multiplayer
Fix #818 
This fix disable strip on client if current client is multiplayer .
#### Checklist

* [x] Use a separate branch in your local repo (not `master`).
* [x] Test coverage is 100% (or you have a story for why it's ok).


Patch:
diff --git a/src/client/client.ts b/src/client/client.ts
index ed69b66..187b0d5 100644
--- a/src/client/client.ts
+++ b/src/client/client.ts
@@ -435,7 +435,11 @@ export class _ClientImpl<G extends any = any> {
     // Secrets are normally stripped on the server,
     // but we also strip them here so that game developers
     // can see their effects while prototyping.
-    const G = this.game.playerView(state.G, state.ctx, this.playerID);
+    // Do not strip again if this is a multiplayer game
+    // since the server has already stripped secret info. (issue #818)
+    const G = this.multiplayer
+      ? state.G
+      : this.game.playerView(state.G, state.ctx, this.playerID);
 
     // Combine into return value.
     return {


Test patch:
diff --git a/src/client/client.test.ts b/src/client/client.test.ts
index e799a41..dd674ae 100644
--- a/src/client/client.test.ts
+++ b/src/client/client.test.ts
@@ -261,6 +261,46 @@ describe('multiplayer', () => {
   });
 });
 
+describe('strip secret only on server', () => {
+  let client0;
+  let client1;
+  let spec;
+  let initial = { secret: [1, 2, 3, 4], sum: 0 };
+  beforeAll(() => {
+    spec = {
+      game: {
+        setup: () => initial,
+        playerView: (G, ctx, playerID) => {
+          let r = { ...G };
+          r.sum = r.secret.reduce((prev, curr) => {
+            return prev + curr;
+          });
+          delete r.secret;
+          return r;
+        },
+        moves: { A: (G, ctx) => ({ A: ctx.playerID }) },
+      },
+      multiplayer: Local(),
+    };
+
+    client0 = Client({ ...spec, playerID: '0' });
+    client1 = Client({ ...spec, playerID: '1' });
+
+    client0.start();
+    client1.start();
+  });
+
+  test('secret stripped', () => {
+    expect(client0.getState().G).toEqual({ sum: 10 });
+    expect(client1.getState().G).toEqual({ sum: 10 });
+  });
+
+  afterAll(() => {
+    client0.stop();
+    client1.stop();
+  });
+});
+
 test('accepts enhancer for store', () => {
   let spyDispatcher;
   const spyEnhancer = vanillaCreateStore => (...args) => {
Repository: jlongster/prettier (js)

Issue:
Missing parenthesis for typeof and arrow functions
```js
typeof (() => {});
```

outputs

```
typeof () => {};
```

which is invalid

https://jlongster.github.io/prettier/#%7B%22content%22%3A%22typeof%20(()%20%3D%3E%20%7B%7D)%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3Afalse%2C%22bracketSpacing%22%3Atrue%7D%7D

Pull request:
Fix missing parenthesis for typeof and arrow functions
Fixes #242

Patch:
diff --git a/src/fast-path.js b/src/fast-path.js
index af4392cb6..dd4b2b55e 100644
--- a/src/fast-path.js
+++ b/src/fast-path.js
@@ -371,11 +371,14 @@ FPp.needsParens = function(assumeExpressionContext) {
         return true;
       }
 
-      if (parent.type === "MemberExpression") {
-        return true;
-      }
+      switch (parent.type) {
+        case "MemberExpression":
+        case "UnaryExpression":
+          return true;
 
-      return isBinary(parent);
+        default:
+          return isBinary(parent);
+      }
 
     case "ClassExpression":
       return parent.type === "ExpressionStatement";


Test patch:
diff --git a/tests/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/arrows/__snapshots__/jsfmt.spec.js.snap
index 728c2470a..bf224ddd7 100644
--- a/tests/arrows/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/arrows/__snapshots__/jsfmt.spec.js.snap
@@ -27,9 +27,12 @@ var ident = <T>(x: T): T => x;
 
 exports[`test arrow_function_expression.js 1`] = `
 "(a => {}).length
+typeof (() => {});
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 (a => {
 }).length;
+typeof (() => {
+});
 "
 `;
 
diff --git a/tests/arrows/arrow_function_expression.js b/tests/arrows/arrow_function_expression.js
index ecea2142f..57a6e9209 100644
--- a/tests/arrows/arrow_function_expression.js
+++ b/tests/arrows/arrow_function_expression.js
@@ -1,1 +1,2 @@
 (a => {}).length
+typeof (() => {});