PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: pyfar/pyfar (python)
Issue: Coordinates __getitem__, slicing bug
## Description

Slicing of coordinates changes the original object instead of returning a new object.

## What I Did

```
import pyfar
coords = pyfar.Coordinates([0,1], [0,1], [0,1])
coords_sliced = coords[0]
coords.cshape == (2,)
```
Pull request description: Coordinates __getitem__ bugfix
### Which issue(s) are closed by this pull request?

Closes #122 

### Changes proposed in this pull request:

- New Coordinates object is returned by calling self.copy()
- Added test

Patch:
diff --git a/pyfar/coordinates.py b/pyfar/coordinates.py
index acf494a0..38f3848e 100644
--- a/pyfar/coordinates.py
+++ b/pyfar/coordinates.py
@@ -1632,9 +1632,9 @@ class Coordinates(object):
         return kdtree
 
     def __getitem__(self, index):
-        """Return mutable slice of Coordinates object at index."""
+        """Return copied slice of Coordinates object at index."""
 
-        new = self
+        new = self.copy()
         # slice points
         new._points = new._points[index]
         # slice weights


Test patch:
diff --git a/tests/test_coordinates.py b/tests/test_coordinates.py
index 5e863d88..13df4bc3 100644
--- a/tests/test_coordinates.py
+++ b/tests/test_coordinates.py
@@ -413,6 +413,13 @@ def test_getitem():
     assert isinstance(new, Coordinates)
     assert new.cshape == (1, 5)
 
+    # test if sliced object stays untouched
+    coords = Coordinates([0, 1], [0, 1], [0, 1])
+    new = coords[0]
+    new.set_cart(2, 2, 2)
+    assert coords.cshape == (2,)
+    npt.assert_allclose(coords.get_cart()[0], np.array([0, 0, 0]))
+
 
 def test_get_nearest_k():
     # 1D cartesian, nearest point
Repository: hub4j/github-api (java)
Issue: GHIssueStateReason should add reopened
While going against a repository I am involved with, I recieved this message in the console:
````
org.kohsuke.github.internal.EnumUtils getEnumOrDefault
WARNING: Unknown value reopened for enum class org.kohsuke.github.GHIssueStateReason, defaulting to UNKNOWN
````
Would be best if it was added for proper recognition.
Pull request description: Issue #2026: added reopened to GHIssueStateReason
# Description

Fixes #2026

# Before submitting a PR:

- [X] Changes must not break binary backwards compatibility. If you are unclear on how to make the change you think is needed while maintaining backward compatibility, [CONTRIBUTING.md](CONTRIBUTING.md) for details.
- [X] Add JavaDocs and other comments explaining the behavior. 
- [X] When adding or updating methods that fetch entities, add `@link` JavaDoc entries to the relevant documentation on https://docs.github.com/en/rest . 
- [X] Add tests that cover any added or changed code. This generally requires capturing snapshot test data. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
- [X] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.
- [X] Push your changes to a branch other than `main`. You will create your PR from that branch.

# When creating a PR: 

- [X] Fill in the "Description" above with clear summary of the changes. This includes:
  - [X] If this PR fixes one or more issues, include "Fixes #<issue number>" lines for each issue. 
  - [X] Provide links to relevant documentation on https://docs.github.com/en/rest where possible. If not including links, explain why not.
- [X] All lines of new code should be covered by tests as reported by code coverage. Any lines that are not covered must have PR comments explaining why they cannot be covered. For example, "Reaching this particular exception is hard and is not a particular common scenario."
- [X] Enable "Allow edits from maintainers".


Patch:
diff --git a/src/main/java/org/kohsuke/github/GHIssueStateReason.java b/src/main/java/org/kohsuke/github/GHIssueStateReason.java
index 229af9f6e..44acdef00 100644
--- a/src/main/java/org/kohsuke/github/GHIssueStateReason.java
+++ b/src/main/java/org/kohsuke/github/GHIssueStateReason.java
@@ -11,6 +11,9 @@ public enum GHIssueStateReason {
     /** Closed as not planned **/
     NOT_PLANNED,
 
+    /** Re-opened **/
+    REOPENED,
+
     /** Uknown **/
     UNKNOWN
 }


Test patch:
diff --git a/src/test/java/org/kohsuke/github/EnumTest.java b/src/test/java/org/kohsuke/github/EnumTest.java
index 2e509b5ae..86c406623 100644
--- a/src/test/java/org/kohsuke/github/EnumTest.java
+++ b/src/test/java/org/kohsuke/github/EnumTest.java
@@ -54,7 +54,7 @@ public class EnumTest extends AbstractGitHubWireMockTest {
 
         assertThat(GHIssueState.values().length, equalTo(3));
 
-        assertThat(GHIssueStateReason.values().length, equalTo(3));
+        assertThat(GHIssueStateReason.values().length, equalTo(4));
 
         assertThat(GHMarketplaceAccountType.values().length, equalTo(2));
Repository: vaskoz/dailycodingproblem-go (go)
Issue: Day 37
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

The power set of a set is the set of all its subsets. Write a function that, given a set, generates its power set.

For example, given the set {1, 2, 3}, it should return {{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.

You may also use a list or array to represent a set.
Pull request description: Day37
Resolves #81 .

Patch:
diff --git a/README.md b/README.md
index f9dafaf..88f6aff 100644
--- a/README.md
+++ b/README.md
@@ -48,3 +48,4 @@ problems from
 * [Day 33](https://github.com/vaskoz/dailycodingproblem-go/issues/73)
 * [Day 35](https://github.com/vaskoz/dailycodingproblem-go/issues/77)
 * [Day 36](https://github.com/vaskoz/dailycodingproblem-go/issues/79)
+* [Day 37](https://github.com/vaskoz/dailycodingproblem-go/issues/81)
diff --git a/day37/problem.go b/day37/problem.go
new file mode 100644
index 0000000..6ab7096
--- /dev/null
+++ b/day37/problem.go
@@ -0,0 +1,18 @@
+package day37
+
+import "math/bits"
+
+// PowerSet returns all subsets.
+func PowerSet(set []int) [][]int {
+	result := make([][]int, 0, 1<<uint64(len(set)))
+	for i := uint64(0); i < (1 << uint64(len(set))); i++ {
+		entry := make([]int, 0, bits.OnesCount64(i))
+		for pos := 0; pos < len(set); pos++ {
+			if i&(1<<uint64(pos)) != 0 {
+				entry = append(entry, set[pos])
+			}
+		}
+		result = append(result, entry)
+	}
+	return result
+}


Test patch:
diff --git a/day37/problem_test.go b/day37/problem_test.go
new file mode 100644
index 0000000..4ef8997
--- /dev/null
+++ b/day37/problem_test.go
@@ -0,0 +1,39 @@
+package day37
+
+import (
+	"reflect"
+	"testing"
+)
+
+var testcases = []struct {
+	input    []int
+	expected [][]int
+}{
+	{[]int{1, 2, 3}, [][]int{{}, {1}, {2}, {1, 2}, {3}, {1, 3}, {2, 3}, {1, 2, 3}}},
+	{[]int{4, 2, 3, 6}, [][]int{{}, {4}, {2}, {4, 2}, {3}, {4, 3}, {2, 3},
+		{4, 2, 3}, {6}, {4, 6}, {2, 6}, {4, 2, 6}, {3, 6}, {4, 3, 6}, {2, 3, 6}, {4, 2, 3, 6}}},
+}
+
+func TestPowerSet(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		result := PowerSet(tc.input)
+		if len(result) != len(tc.expected) {
+			t.Errorf("Length of result doesn't match. Expected %v got %v", len(tc.expected), len(result))
+			continue
+		}
+		for i := range result {
+			if !reflect.DeepEqual(result[i], tc.expected[i]) {
+				t.Errorf("Expected %v got %v", tc.expected[i], result[i])
+			}
+		}
+	}
+}
+
+func BenchmarkPowerSet(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			PowerSet(tc.input)
+		}
+	}
+}
Repository: jsonata-js/jsonata (js)
Issue: Inconsistent Behavior of [] between version 1.7.0 and 1.8.3
Consider the following input:
```
{
  "singleArray": [{"foo":"bar"}]
}
```
and JSONata expression:
`singleArray[]`

In version 1.7.0, the evaluated result is 
```
[
  {
    "foo": "bar"
  }
]
```
but in 1.8.3 it is
```
[
  [
    {
      "foo": "bar"
    }
  ]
]
```
Which evaluation is correct and why?
Pull request description: fix regression with singleton sequence of array type
Change the logic for promoting a singleton sequence of array type into an array of arrays.  The logic was put in to fix issue #399 but caused an unintended regression as described in issue #462.

resolves #462

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>

Patch:
diff --git a/src/jsonata.js b/src/jsonata.js
index e1d6092..1a0488a 100644
--- a/src/jsonata.js
+++ b/src/jsonata.js
@@ -219,7 +219,8 @@ var jsonata = (function() {
         }
 
         if(expr.keepSingletonArray) {
-            if(!isSequence(resultSequence)) {
+            // if the array is explicitly constructed in the expression and marked to promote singleton sequences to array
+            if(Array.isArray(resultSequence) && resultSequence.cons && !resultSequence.sequence) {
                 resultSequence = createSequence(resultSequence);
             }
             resultSequence.keepSingleton = true;


Test patch:
diff --git a/test/test-suite/groups/array-constructor/array-sequences.json b/test/test-suite/groups/array-constructor/array-sequences.json
new file mode 100644
index 0000000..4cb0e4d
--- /dev/null
+++ b/test/test-suite/groups/array-constructor/array-sequences.json
@@ -0,0 +1,68 @@
+[
+    {
+        "expr": "$.[value,epochSeconds][]",
+        "data": [
+            {
+                "epochSeconds": 1578381600,
+                "value": 3
+            },
+            {
+                "epochSeconds": 1578381700,
+                "value": 5
+            }
+        ],
+        "bindings": {},
+        "result": [
+            [3, 1578381600],
+            [5, 1578381700]
+        ]
+    },
+    {
+        "expr": "$.[value,epochSeconds][]",
+        "data": [
+            {
+                "epochSeconds": 1578381600,
+                "value": 3
+            }
+        ],
+        "bindings": {},
+        "result": [
+            [3, 1578381600]
+        ]
+    },
+    {
+        "expr": "$.[value,epochSeconds]",
+        "data": [
+            {
+                "epochSeconds": 1578381600,
+                "value": 3
+            }
+        ],
+        "bindings": {},
+        "result": [3, 1578381600]
+    },
+    {
+        "expr": "singleArray",
+        "data": {
+            "singleArray": [{"foo":"bar"}]
+        },
+        "bindings": {},
+        "result": [
+            {
+                "foo": "bar"
+            }
+        ]
+    },
+    {
+        "expr": "singleArray[]",
+        "data": {
+            "singleArray": [{"foo":"bar"}]
+        },
+        "bindings": {},
+        "result": [
+            {
+                "foo": "bar"
+            }
+        ]
+    }
+]