PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: Yoctol/bottender (ts)
Issue: [Fb Messenger] - Error about user
With this new policy about facebook now i'm getting this error:

```
TypeError: Cannot assign to read only property 'user' of object '#<Object>'
    at MessengerConnector.updateSession (C:\Users\Avell\projetos\asksuite-facebook\node_modules\bottender\lib\bot\MessengerConnector.js:160:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)
```

Pull request description: deepClone when read from MemoryCacheStore
cloneDeep: To make sure read as different object to prevent reading same key multiple times, causing freezed by other events.

fix #221
maybe related with #231 

Patch:
diff --git a/src/cache/MemoryCacheStore.js b/src/cache/MemoryCacheStore.js
index 62fc8890..be6d1976 100644
--- a/src/cache/MemoryCacheStore.js
+++ b/src/cache/MemoryCacheStore.js
@@ -13,7 +13,12 @@ export default class MemoryCacheStore implements CacheStore {
   }
 
   async get(key: string): Promise<mixed> {
-    const value = await this._lru.get(key);
+    const _value = this._lru.get(key);
+
+    // cloneDeep: To make sure read as different object to prevent
+    // reading same key multiple times, causing freezed by other events.
+    const value = typeof _value === 'object' ? cloneDeep(_value) : _value;
+
     return value || null;
   }
 


Test patch:
diff --git a/src/cache/__tests__/MemoryCacheStore.spec.js b/src/cache/__tests__/MemoryCacheStore.spec.js
index ecfa5271..cd6c19c1 100644
--- a/src/cache/__tests__/MemoryCacheStore.spec.js
+++ b/src/cache/__tests__/MemoryCacheStore.spec.js
@@ -8,6 +8,18 @@ describe('#get', () => {
     expect(await store.get('x')).toBe('abc');
   });
 
+  it('should get different object when get multiple times', async () => {
+    const store = new MemoryCacheStore(5);
+
+    await store.put('x', { a: 1 }, 5);
+
+    const result1 = await store.get('x');
+    const result2 = await store.get('x');
+
+    expect(result1).not.toBe(result2);
+    expect(result1).toEqual(result2);
+  });
+
   it('should get null when value does not exist', async () => {
     const store = new MemoryCacheStore(5);
Repository: more-itertools/more-itertools (python)
Issue: One more nit on all_equal()
I missed something during the code review.  There is an extra unnecessary `next` call in the first for-loop.  This is easily solved by adding another `return True`.

```
def all_equal(iterable, key=None):
    iterator = groupby(iterable, key)
    for first in iterator:
        for second in iterator:
            return False
        return True                          # <== This was missed
    return True
```

For example, `all_equal('a')` calls the `groupby.__next__` three times.

This is can be made visible by replacing `groupby` with `verbose_groupby`:

```
class verbose_groupby(itertools.groupby):

    def __next__(self):
        print('N')
        return super().__next__()
```

Pull request description: Reduce groupby.__next__ calls in all_equal
This PR implements @rhettinger's suggestion in issue 902.

Closes #902 

Patch:
diff --git a/more_itertools/recipes.py b/more_itertools/recipes.py
index f7db03b..67f76fa 100644
--- a/more_itertools/recipes.py
+++ b/more_itertools/recipes.py
@@ -222,6 +222,7 @@ def all_equal(iterable, key=None):
     for first in iterator:
         for second in iterator:
             return False
+        return True
     return True
 
 


Test patch:
diff --git a/tests/test_recipes.py b/tests/test_recipes.py
index d3762d4..684a6fc 100644
--- a/tests/test_recipes.py
+++ b/tests/test_recipes.py
@@ -2,11 +2,12 @@ from decimal import Decimal
 from doctest import DocTestSuite
 from fractions import Fraction
 from functools import reduce
-from itertools import combinations, count, permutations
+from itertools import combinations, count, groupby, permutations
 from operator import mul
 from math import factorial
 from sys import version_info
 from unittest import TestCase, skipIf
+from unittest.mock import patch
 
 import more_itertools as mi
 
@@ -158,6 +159,22 @@ class AllEqualTests(TestCase):
         self.assertTrue(mi.all_equal('4٤໔４৪', key=int))
         self.assertFalse(mi.all_equal('Abc', key=str.casefold))
 
+    @patch('more_itertools.recipes.groupby', autospec=True)
+    def test_groupby_calls(self, mock_groupby):
+        next_count = 0
+
+        class _groupby(groupby):
+            def __next__(true_self):
+                nonlocal next_count
+                next_count += 1
+                return super().__next__()
+
+        mock_groupby.side_effect = _groupby
+        iterable = iter('aaaaa')
+        self.assertTrue(mi.all_equal(iterable))
+        self.assertEqual(list(iterable), [])
+        self.assertEqual(next_count, 2)
+
 
 class QuantifyTests(TestCase):
     """Tests for ``quantify()``"""
Repository: pion/ice (go)
Issue: ICE connection fails when RTT > 500 msec

### Your environment.
  - Version: pion/ice v0.7.17 (pion/webrtc v2.2.21)
  - Browser: n/a

### What did you do?
Try to establish connection (the test app uses a data channel) between two nodes with large latency (using comcast)

### What did you expect?
The connection would establish successfully with RTT 500 msec or greater.

### What happened?
ICE connection fails with this line in the console output:
```
ice TRACE: 00:47:20.775035 agent.go:1039: Discarded 1 binding requests because they expired
```

Looking at the code (agent.go), the current implementation discards the binding request transaction in 500 msec.
500 msec is too short for STUN transaction to expire. In RFC 5439, when initial RTO=500msec, Rc=7, Rm=16, then the transaction is expected to fail in 39500msec (or 39.5 seconds). 

Pull request description: Increase binding req timeout value
Resolves #255

#### Description
See #255 for details

Per discussion with @Sean-Der we decided to simply increase the maxBindingRequestTImeout from 500msec to 4000msec.

Patch:
diff --git a/agent_config.go b/agent_config.go
index 25c38f0..c7198af 100644
--- a/agent_config.go
+++ b/agent_config.go
@@ -39,7 +39,7 @@ const (
 	maxBufferSize = 1000 * 1000 // 1MB
 
 	// wait time before binding requests can be deleted
-	maxBindingRequestTimeout = 500 * time.Millisecond
+	maxBindingRequestTimeout = 4000 * time.Millisecond
 )
 
 var (


Test patch:
diff --git a/agent_test.go b/agent_test.go
index 0f9bba0..966c71e 100644
--- a/agent_test.go
+++ b/agent_test.go
@@ -1208,20 +1208,20 @@ func TestBindingRequestTimeout(t *testing.T) {
 
 	now := time.Now()
 	a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
-		timestamp: now,
+		timestamp: now, // valid
 	})
 	a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
-		timestamp: now.Add(-25 * time.Millisecond),
+		timestamp: now.Add(-3900 * time.Millisecond), // valid
 	})
 	a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
-		timestamp: now.Add(-750 * time.Millisecond),
+		timestamp: now.Add(-4100 * time.Millisecond), // invalid
 	})
 	a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
-		timestamp: now.Add(-75 * time.Hour),
+		timestamp: now.Add(-75 * time.Hour), // invalid
 	})
 
 	a.invalidatePendingBindingRequests(now)
-	assert.Equal(t, len(a.pendingBindingRequests), expectedRemovalCount, "Binding invalidation due to timeout did not remove the correct number of binding requests")
+	assert.Equal(t, expectedRemovalCount, len(a.pendingBindingRequests), "Binding invalidation due to timeout did not remove the correct number of binding requests")
 	assert.NoError(t, a.Close())
 }
Repository: QuantEcon/QuantEcon.py (python)
Issue: BUG: lcp_lemke
Bug found by an instance in some benchmark script generated by ChatGPT:

```python
import numpy as np
from quantecon.optimize import lcp_lemke

n = 10
seed = 0
rng = np.random.RandomState(seed)
A = rng.standard_normal((n, n))
M = A.T @ A + np.eye(n)
q = rng.standard_normal(n)
res = lcp_lemke(M, q)
res.z
```

```
array([ 0.        ,  0.        ,  0.3476126 ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.27700921,  0.        , -0.40131452])
```

The condition `z >= 0` is violated.
Pull request description: FIX: lcp_lemke: Fix bug in first iteration
Fix #768

Bug spotted by Deep Research by ChatGPT o4-mini-high.
(Given the failure reported in #768, I prompted ChatGPT to read the relevant files and identify the bug; it successfully did.)

Patch:
diff --git a/quantecon/optimize/lcp_lemke.py b/quantecon/optimize/lcp_lemke.py
index 2ee54f9..b0464ec 100644
--- a/quantecon/optimize/lcp_lemke.py
+++ b/quantecon/optimize/lcp_lemke.py
@@ -150,7 +150,7 @@ def lcp_lemke(M, q, d=None, max_iter=10**6, piv_options=PivOptions(),
         ratio = q[i] / d[i]
         if ratio <= ratio_min + piv_options.tol_ratio_diff:
             pivrow = i
-            ratio = ratio_min
+            ratio_min = ratio
 
     _pivoting(tableau, pivcol, pivrow)
     basis[pivrow], pivcol = pivcol, pivrow + n


Test patch:
diff --git a/quantecon/optimize/tests/test_lcp_lemke.py b/quantecon/optimize/tests/test_lcp_lemke.py
index 15d2707..457b252 100644
--- a/quantecon/optimize/tests/test_lcp_lemke.py
+++ b/quantecon/optimize/tests/test_lcp_lemke.py
@@ -107,3 +107,13 @@ class TestLCPLemke:
 
         res = lcp_lemke(M, q)
         _assert_success(res, M, q)
+
+    def test_bug_768(self):
+        n = 10
+        seed = 0
+        rng = np.random.RandomState(seed)
+        A = rng.standard_normal((n, n))
+        M = A.T @ A + np.eye(n)
+        q = rng.standard_normal(n)
+        res = lcp_lemke(M, q)
+        _assert_success(res, M, q)
Repository: typescript-eslint/tslint-to-eslint-config (ts)
Issue: Don't log "0 new packages are required"
### 🐛 Bug Report

-   `tslint-to-eslint-config` version: 1.0.0-beta
-   ESLint version: N/A
-   Node version: N/A

#### Actual Behavior

After already having run `npx tslint-to-eslint-config` and the recommended `npm install` command:

```
npx tslint-to-eslint-config --prettier

♻ 1875 files of TSLint comment directives converted to ESLint. ♻

⚡ 0 new packages are required for this ESLint configuration. ⚡
  npm install  --save-dev

✅ All is well! ✅
```

#### Expected Behavior

If there are no new packages, don't bother.
Pull request description: Stopped logging package notice when none are missing
## PR Checklist

-   [x] Addresses an existing issue: fixes #445
-   [x] That issue was marked as [`status: accepting prs`](https://github.com/typescript-eslint/tslint-to-eslint-config/labels/status%3A%20accepting%20prs)

## Overview

This worked out nicely.

Patch:
diff --git a/src/reporting/packages/logMissingPackages.ts b/src/reporting/packages/logMissingPackages.ts
index 504650b..8a662e6 100644
--- a/src/reporting/packages/logMissingPackages.ts
+++ b/src/reporting/packages/logMissingPackages.ts
@@ -39,6 +39,10 @@ export const logMissingPackages = async (
         .filter((packageName) => !existingPackageNames.has(packageName))
         .sort();
 
+    if (missingPackageNames.length === 0) {
+        return;
+    }
+
     dependencies.logger.stdout.write(chalk.cyanBright(`${EOL}⚡ ${missingPackageNames.length}`));
     dependencies.logger.stdout.write(
         chalk.cyan(


Test patch:
diff --git a/src/reporting/packages/logMissingPackages.test.ts b/src/reporting/packages/logMissingPackages.test.ts
index a0c3c21..7396d25 100644
--- a/src/reporting/packages/logMissingPackages.test.ts
+++ b/src/reporting/packages/logMissingPackages.test.ts
@@ -9,6 +9,25 @@ const createStubDependencies = (packageManager = PackageManager.npm) => ({
 });
 
 describe("logMissingPackages", () => {
+    it("does nothing when no package are missing", async () => {
+        // Arrange
+        const { choosePackageManager, logger } = createStubDependencies(PackageManager.npm);
+        const ruleConversionResults = createEmptyConversionResults();
+
+        // Act
+        await logMissingPackages({ choosePackageManager, logger }, ruleConversionResults, {
+            dependencies: {
+                "@typescript-eslint/eslint-plugin": "*",
+                "@typescript-eslint/parser": "*",
+                eslint: "*",
+            },
+            devDependencies: {},
+        });
+
+        // Assert
+        expectEqualWrites(logger.stdout.write);
+    });
+
     it("reports a singular message when one package is missing", async () => {
         // Arrange
         const { choosePackageManager, logger } = createStubDependencies(PackageManager.npm);
Repository: nephila/python-taiga (python)
Issue: AttributeError: 'History' object has no attribute 'id'
Hi,

I think one of the latest taiga-back commits broke python-taiga if not entirely but quite badly.
I see they made changes to the history management in taiga-back (they fixed something with timeline history loops on fresh projects) and I suppose it had some effect on this tool.

This gets raised when I'm trying to get a project by its slug:
`AttributeError: 'History' object has no attribute 'id'`

Got no idea where to fix it yet.
Pull request description: Fix repr error on History object
Fix the History object `repr` / `str`

Fix #78 

Patch:
diff --git a/taiga/models/base.py b/taiga/models/base.py
index cd6b4eb..90fa1d0 100644
--- a/taiga/models/base.py
+++ b/taiga/models/base.py
@@ -232,7 +232,10 @@ class InstanceResource(Resource):
         return cls(requester, **entry)
 
     def __repr__(self):
-        return '{0}({1})'.format(self.__class__.__name__, self.id)
+        try:
+            return '{0}({1})'.format(self.__class__.__name__, self.id)
+        except AttributeError:
+            return '{0}({1})'.format(self.__class__.__name__, id(self))
 
     def __str__(self):
         return self._rp()


Test patch:
diff --git a/tests/test_history.py b/tests/test_history.py
index 175000b..3ebb1f8 100644
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -9,6 +9,16 @@ from .tools import MockResponse, create_mock_json
 
 class TestHistory(unittest.TestCase):
 
+    @patch('taiga.requestmaker.RequestMaker.get')
+    def test_history_repr(self, mock_requestmaker_get):
+        mock_requestmaker_get.return_value = MockResponse(
+            200,
+            create_mock_json('tests/resources/history_success.json')
+        )
+        api = TaigaAPI(token='f4k3')
+        api.history.issue.get(1)
+        self.assertTrue('History' in str(api.history))
+
     @patch('taiga.requestmaker.RequestMaker.get')
     def test_issue(self, mock_requestmaker_get):
         mock_requestmaker_get.return_value = MockResponse(