PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: ktsn/vuex-smart-module (ts)

Issue:
Problem with migrating an existing project
Hello, @ktsn, how can i use modules in root and in options in same time? like this
```
const root = new Module({
  modules: {
    // typed modules
  },
})

export const store = createStore(
  root,
  {
    modules: {
        // non typed modules
      }
  }
)
```
spread operator removes modules from `rootModuleOptions`
probably problem in creating `new Store` [https://github.com/ktsn/vuex-smart-module/blob/cfbfaaa03471c7ab3cb96cc30d51c8c9021583f9/src/index.ts#L17](https://github.com/ktsn/vuex-smart-module/blob/cfbfaaa03471c7ab3cb96cc30d51c8c9021583f9/src/index.ts#L17)

can do the same as with plugins? and i can create a PR if you agree
```
new Store({
    ...rootModuleOptions,
    ...options,
    modules: {
       ...rootModuleOptions.modules,
       ...options.modules,
    },
    plugins: [injectStore].concat(options.plugins || []),
  })
```
this would greatly simplify the project migration

Pull request:
feat: merge with raw vuex modules shallowly
fix #339 



Patch:
diff --git a/src/index.ts b/src/index.ts
index ebe7360..984e03f 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -17,6 +17,10 @@ export function createStore(
   const store: Store<any> = new Store({
     ...rootModuleOptions,
     ...options,
+    modules: {
+      ...rootModuleOptions.modules,
+      ...options.modules,
+    },
     plugins: [injectStore].concat(options.plugins || []),
   })
 


Test patch:
diff --git a/test/module.spec.ts b/test/module.spec.ts
index cbeda19..1b5c5e2 100644
--- a/test/module.spec.ts
+++ b/test/module.spec.ts
@@ -179,6 +179,31 @@ describe('Module', () => {
       expect(store.state.foo.bar.value).toBe(2)
       expect(store.state.foo.bar.baz.value).toBe(2)
     })
+
+    it('preserve raw vuex modules option', () => {
+      const foo = new Module({
+        state: FooState,
+      })
+
+      const root = new Module({
+        modules: {
+          foo,
+        },
+      })
+
+      const store = createStore(root, {
+        modules: {
+          bar: {
+            state: {
+              value: 'bar',
+            },
+          },
+        },
+      })
+
+      expect(store.state.foo.value).toBe(1)
+      expect(store.state.bar.value).toBe('bar')
+    })
   })
 
   describe('getters', () => {
Repository: MartinThoma/flake8-simplify (python)

Issue:
[Adjust Rule] Remove SIM116 due to inefficiency/code evaluation problem
## Desired change

* **Rule(s)**: SIM116
* **Adjustment**: Remove the enforcement of the rule #31 

## Explanation

This style guideline may result in better looking code, but it is inefficient and can even create errors. Each dict value is interpreted whenever the dict is evaluated.

## Example

```python
some_array = [0,1] if x else [0,1,2]
mapping = {
  "foo": "bar",
  "foo2": long_expensive_function()
  "foo3": three_arg_func(some_array[0], some_array[1], some_array[2])
}
return mapping.get("foo",42) # This will still evaluate "foo2", and if x is True, completely crash when evaluating "foo3"
```



Pull request:
SIM116: Fix false-positive
When a function is called, we cannot simply convert the if-else
block to a dictionary.

Closes #113

Patch:
diff --git a/flake8_simplify/rules/ast_if.py b/flake8_simplify/rules/ast_if.py
index 6f2b74e..eacf557 100644
--- a/flake8_simplify/rules/ast_if.py
+++ b/flake8_simplify/rules/ast_if.py
@@ -275,6 +275,11 @@ def get_sim116(node: ast.If) -> List[Tuple[int, int, str]]:
             and len(child.orelse) <= 1
         ):
             return errors
+        return_call = child.body[0]
+        assert isinstance(return_call, ast.Return), "hint for mypy"
+        if isinstance(return_call.value, ast.Call):
+            # See https://github.com/MartinThoma/flake8-simplify/issues/113
+            return errors
         key: Any
         if isinstance(child.test.comparators[0], ast.Str):
             key = child.test.comparators[0].s


Test patch:
diff --git a/tests/test_100_rules.py b/tests/test_100_rules.py
index 49d9c69..715263e 100644
--- a/tests/test_100_rules.py
+++ b/tests/test_100_rules.py
@@ -430,6 +430,21 @@ else:
     }
 
 
+def test_sim116_false_positive():
+    ret = _results(
+        """if a == "foo":
+    return "bar"
+elif a == "bar":
+    return baz()
+elif a == "boo":
+    return "ooh"
+else:
+    return 42"""
+    )
+    for el in ret:
+        assert "SIM116" not in el
+
+
 def test_sim117():
     ret = _results(
         """with A() as a:
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 29
Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Run-length encoding is a fast and simple method of encoding strings. The basic idea is to represent repeated successive characters as a single count and character. For example, the string "AAAABBBCCDAA" would be encoded as "4A3B2C1D2A".

Implement run-length encoding and decoding. You can assume the string to be encoded have no digits and consists solely of alphabetic characters. You can assume the string to be decoded is valid.

Pull request:
Day29
Resolves #67 

Patch:
diff --git a/README.md b/README.md
index 57c1d48..b465c34 100644
--- a/README.md
+++ b/README.md
@@ -42,3 +42,4 @@ problems from
 * [Day 26](https://github.com/vaskoz/dailycodingproblem-go/issues/61)
 * [Day 27](https://github.com/vaskoz/dailycodingproblem-go/issues/63)
 * [Day 28](https://github.com/vaskoz/dailycodingproblem-go/issues/65)
+* [Day 29](https://github.com/vaskoz/dailycodingproblem-go/issues/67)
diff --git a/day29/problem.go b/day29/problem.go
new file mode 100644
index 0000000..c520166
--- /dev/null
+++ b/day29/problem.go
@@ -0,0 +1,49 @@
+package day29
+
+import (
+	"strconv"
+	"strings"
+)
+
+// RunLengthEncoding takes a string of runes [A-Z] and encodes it using run-length.
+func RunLengthEncoding(str string) string {
+	var sb strings.Builder
+	var count int
+	var last rune
+	for i, r := range str {
+		if i == 0 {
+			count++
+			last = r
+			continue
+		} else if r == last {
+			count++
+		} else {
+			sb.WriteString(strconv.Itoa(count))
+			sb.WriteString(string(last))
+			count = 1
+			last = r
+		}
+	}
+	sb.WriteString(strconv.Itoa(count))
+	sb.WriteString(string(last))
+	return sb.String()
+}
+
+// RunLengthDecoding takes a run-length encoding and returns the original string.
+func RunLengthDecoding(str string) string {
+	var sb strings.Builder
+	var count int
+	for _, r := range str {
+		if r >= 'A' && r <= 'Z' {
+			sb.WriteString(strings.Repeat(string(r), count))
+			count = 0
+		} else {
+			if count != 0 {
+				count *= 10
+			}
+			digit, _ := strconv.Atoi(string(r))
+			count += digit
+		}
+	}
+	return sb.String()
+}


Test patch:
diff --git a/day29/problem_test.go b/day29/problem_test.go
new file mode 100644
index 0000000..f04f100
--- /dev/null
+++ b/day29/problem_test.go
@@ -0,0 +1,30 @@
+package day29
+
+import "testing"
+
+var testcases = []struct {
+	orig, encoded string
+}{
+	{"AAAABBBCCDAA", "4A3B2C1D2A"},
+	{"AAAAAAAAAAA", "11A"},
+}
+
+func TestRunLength(t *testing.T) {
+	for _, tc := range testcases {
+		var enc string
+		if enc = RunLengthEncoding(tc.orig); enc != tc.encoded {
+			t.Errorf("Expected %v but got %v", tc.encoded, enc)
+		}
+		if dec := RunLengthDecoding(enc); dec != tc.orig {
+			t.Errorf("Expected %v but got %v", tc.orig, dec)
+		}
+	}
+}
+
+func BenchmarkRunLength(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			RunLengthDecoding(RunLengthEncoding(tc.orig))
+		}
+	}
+}
Repository: jira-node/node-jira-client (js)

Issue:
updateAssignee uses deprecated format
updateAssignee uses the format { name: assigneeName }, but using name is deprecated.
Instead the userId should be used. [Jira doc](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-assignee-put)

Pull request:
Change assignee based on accountId instead of name
Closes #281 

Patch:
diff --git a/src/jira.js b/src/jira.js
index 1e7b6fe..1a5df0b 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -788,6 +788,23 @@ export default class JiraApi {
     }));
   }
 
+  /** Change an assignee on an issue
+   * [Jira Doc](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-assignee-put)
+   * @name updateAssigneeWithId
+   * @function
+   * @param {string} issueKey - the key of the existing issue
+   * @param {string} userId - the jira username to add as a new assignee to the issue
+   */
+  updateAssigneeWithId(issueKey, userId) {
+    return this.doRequest(this.makeRequestHeader(this.makeUri({
+      pathname: `/issue/${issueKey}/assignee`,
+    }), {
+      method: 'PUT',
+      followAllRedirects: true,
+      body: { accountId: userId },
+    }));
+  }
+
   /** Delete issue from Jira
    * [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290791)
    * @name deleteIssue


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 240c930..8bf45bb 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -596,6 +596,11 @@ describe('Jira API Tests', () => {
       const result = await dummyURLCall('updateAssignee', ['ZQ-9001', 'Assignee']);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/ZQ-9001/assignee');
     });
+    
+    it('updateAssigneeWithId hits proper url', async () => {
+      const result = await dummyURLCall('updateAssigneeWithId', ['ZQ-9001', 'Assignee']);
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/ZQ-9001/assignee');
+    });
 
     it('deleteIssue hits proper url', async () => {
       const result = await dummyURLCall('deleteIssue', ['FU-69']);
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 257
Good morning! Here's your coding interview problem for today.

This problem was asked by WhatsApp.

Given an array of integers out of order, determine the bounds of the smallest window that must be sorted in order for the entire array to be sorted. For example, given `[3, 7, 5, 6, 9]`, you should return `(1, 3)`.

Pull request:
Day257
Resolves #529.

Patch:
diff --git a/README.md b/README.md
index 57a0148..52f4045 100644
--- a/README.md
+++ b/README.md
@@ -268,4 +268,5 @@ problems from
 * [Day 254](https://github.com/vaskoz/dailycodingproblem-go/issues/523)
 * [Day 255](https://github.com/vaskoz/dailycodingproblem-go/issues/525)
 * [Day 256](https://github.com/vaskoz/dailycodingproblem-go/issues/528)
+* [Day 257](https://github.com/vaskoz/dailycodingproblem-go/issues/529)
 * [Day 258](https://github.com/vaskoz/dailycodingproblem-go/issues/530)
diff --git a/day257/problem.go b/day257/problem.go
new file mode 100644
index 0000000..f73a710
--- /dev/null
+++ b/day257/problem.go
@@ -0,0 +1,26 @@
+package day257
+
+// SmallestWindowThatMustBeSorted returns the smallest window that must be
+// sorted to result in a completely sorted slice.
+func SmallestWindowThatMustBeSorted(nums []int) (start, end int) {
+	maxSoFar := -int(^uint(0)>>1) - 1
+	for i := range nums {
+		if maxSoFar < nums[i] {
+			maxSoFar = nums[i]
+		}
+		if nums[i] < maxSoFar {
+			end = i
+		}
+	}
+	minSoFar := int(^uint(0) >> 1)
+	for i := range nums {
+		j := len(nums) - 1 - i
+		if minSoFar > nums[j] {
+			minSoFar = nums[j]
+		}
+		if nums[j] > minSoFar {
+			start = j
+		}
+	}
+	return
+}


Test patch:
diff --git a/day257/problem_test.go b/day257/problem_test.go
new file mode 100644
index 0000000..a393976
--- /dev/null
+++ b/day257/problem_test.go
@@ -0,0 +1,28 @@
+package day257
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	nums       []int
+	start, end int
+}{
+	{[]int{3, 7, 5, 6, 9}, 1, 3},
+}
+
+func TestSmallestWindowThatMustBeSorted(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if start, end := SmallestWindowThatMustBeSorted(tc.nums); start != tc.start || end != tc.end {
+			t.Errorf("Expected (%v,%v), got (%v,%v)", tc.start, tc.end, start, end)
+		}
+	}
+}
+
+func BenchmarkSmallestWindowThatMustBeSorted(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			SmallestWindowThatMustBeSorted(tc.nums)
+		}
+	}
+}
Repository: JuliaEarth/CoordRefSystems.jl (julia)

Issue:
Review `inbounds` semantics
Some of our current `inbounds` implementations seem to be tied to EPSG code bounds.

For example, the `Mercator` CRS has the following implementation:

https://github.com/JuliaEarth/CoordRefSystems.jl/blob/10b3f944ece7d5c4669eed6dc163ae8d9761afcd/src/crs/projected/mercator.jl#L54-L57

I believe we should use the mathematical definition instead, and allow all values of lat/lon that are in the domain of the formulas.

@eliascarv could you please double check this design decision. Do you agree it would be better to use the mathematical definition always, and encode this EPSG bounds in a separate function? Perhaps `epsgbounds`?

Pull request:
Fix #266

Patch:
diff --git a/src/crs/projected/mercator.jl b/src/crs/projected/mercator.jl
index fbc6eec7..956f94b9 100644
--- a/src/crs/projected/mercator.jl
+++ b/src/crs/projected/mercator.jl
@@ -53,7 +53,7 @@ isconformal(::Type{<:Mercator}) = true
 
 function inbounds(::Type{<:Mercator}, λ, ϕ)
   T = typeof(λ)
-  -T(π) ≤ λ ≤ T(π) && deg2rad(-T(80)) ≤ ϕ ≤ deg2rad(T(84))
+  -T(π) ≤ λ ≤ T(π) && -T(π) / 2 < ϕ < T(π) / 2
 end
 
 function formulas(::Type{<:Mercator{Datum}}, ::Type{T}) where {Datum,T}
diff --git a/src/crs/projected/webmercator.jl b/src/crs/projected/webmercator.jl
index 7406389e..9dc41569 100644
--- a/src/crs/projected/webmercator.jl
+++ b/src/crs/projected/webmercator.jl
@@ -54,8 +54,7 @@ iscompromise(::Type{<:WebMercator}) = true
 
 function inbounds(::Type{<:WebMercator}, λ, ϕ)
   T = typeof(λ)
-  θ = deg2rad(T(85.06))
-  -T(π) ≤ λ ≤ T(π) && -θ ≤ ϕ ≤ θ
+  -T(π) ≤ λ ≤ T(π) && -T(π) / 2 < ϕ < T(π) / 2
 end
 
 function formulas(::Type{<:WebMercator}, ::Type{T}) where {T}


Test patch:
diff --git a/test/crs/domains.jl b/test/crs/domains.jl
index d3f03c1d..21d396d3 100644
--- a/test/crs/domains.jl
+++ b/test/crs/domains.jl
@@ -1,4 +1,5 @@
 @testset "Projection domain" begin
+  c0 = LatLon(T(90), T(0))
   c1 = LatLon(T(30), T(60))
   c2 = LatLon(T(85), T(60))
   c3 = LatLon{ITRF{2008}}(T(30), T(60))
@@ -7,16 +8,20 @@
   c6 = convert(Lambert, c2)
   c7 = Cartesian(T(1), T(2))
   c8 = Cartesian{WGS84Latest}(T(1), T(2))
-  @test indomain(Mercator, c1)
-  @test !indomain(Mercator, c2)
-  @test indomain(Mercator{WGS84Latest}, c1)
-  @test !indomain(Mercator{WGS84Latest}, c2)
-  @test indomain(Mercator{WGS84{1762}}, c3)
-  @test !indomain(Mercator{WGS84{1762}}, c4)
-  @test indomain(Mercator, c5)
-  @test !indomain(Mercator, c6)
-  @test indomain(Mercator{WGS84Latest}, c7)
-  @test indomain(Mercator{WGS84Latest}, c8)
+  for C in [Mercator, WebMercator]
+    @test !indomain(C, c0)
+    @test indomain(C, c1)
+    @test indomain(C, c2)
+    @test !indomain(C{WGS84Latest}, c0)
+    @test indomain(C{WGS84Latest}, c1)
+    @test indomain(C{WGS84Latest}, c2)
+    @test indomain(C{WGS84{1762}}, c3)
+    @test indomain(C{WGS84{1762}}, c4)
+    @test indomain(C, c5)
+    @test indomain(C, c6)
+    @test indomain(C{WGS84Latest}, c7)
+    @test indomain(C{WGS84Latest}, c8)
+  end
 
   for C in projected
     # forward
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 376
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

You are writing an AI for a 2D map game. You are somewhere in a 2D grid, and there are coins strewn about over the map.

Given the position of all the coins and your current position, find the closest coin to you in terms of Manhattan distance. That is, you can move around up, down, left, and right, but not diagonally. If there are multiple possible closest coins, return any of them.

For example, given the following map, where you are `x`, coins are `o`, and empty spaces are `.` (top left is 0, 0):
```
---------------------
| . | . | x | . | o |
---------------------
| o | . | . | . | . |
---------------------
| o | . | . | . | o |
---------------------
| . | . | o | . | . |
---------------------
```

return `(0, 4)`, since that coin is closest. This map would be represented in our question as:
```
Our position: (0, 2)
Coins: [(0, 4), (1, 0), (2, 0), (3, 2)]
```

Pull request:
Day376
Resolves #758.

Patch:
diff --git a/README.md b/README.md
index 19ae309..216311c 100644
--- a/README.md
+++ b/README.md
@@ -371,4 +371,5 @@ problems from
 * [Day 373](https://github.com/vaskoz/dailycodingproblem-go/issues/752)
 * [Day 374](https://github.com/vaskoz/dailycodingproblem-go/issues/754)
 * [Day 375](https://github.com/vaskoz/dailycodingproblem-go/issues/756)
+* [Day 376](https://github.com/vaskoz/dailycodingproblem-go/issues/758)
 
diff --git a/day376/problem.go b/day376/problem.go
new file mode 100644
index 0000000..f5bdb5c
--- /dev/null
+++ b/day376/problem.go
@@ -0,0 +1,30 @@
+package day376
+
+// Pos is a position.
+type Pos struct {
+	Row, Col int
+}
+
+// ClosestCoinToMe returns the closest coin to my position
+// using the Manhattan distance.
+func ClosestCoinToMe(coins []Pos, me Pos) Pos {
+	closest := Pos{}
+	closestDistance := len(coins) * 2
+
+	for _, coin := range coins {
+		if dist := abs(me.Row-coin.Row) + abs(me.Col-coin.Col); dist < closestDistance {
+			closestDistance = dist
+			closest = coin
+		}
+	}
+
+	return closest
+}
+
+func abs(a int) int {
+	if a < 0 {
+		return -a
+	}
+
+	return a
+}


Test patch:
diff --git a/day376/problem_test.go b/day376/problem_test.go
new file mode 100644
index 0000000..552d9d5
--- /dev/null
+++ b/day376/problem_test.go
@@ -0,0 +1,30 @@
+package day376
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	coins    []Pos
+	me       Pos
+	expected Pos
+}{
+	{[]Pos{{0, 4}, {1, 0}, {2, 0}, {3, 2}}, Pos{0, 2}, Pos{0, 4}},
+}
+
+func TestClosestCoinToMe(t *testing.T) {
+	t.Parallel()
+
+	for _, tc := range testcases {
+		if result := ClosestCoinToMe(tc.coins, tc.me); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkClosestCoinToMe(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			ClosestCoinToMe(tc.coins, tc.me)
+		}
+	}
+}