PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: reduxjs/react-redux (ts)

Issue:
`isPlainObject()` util returns `false` for objects without prototypes
`Object.create(null)` produces a plain object whose prototype is `null`. Lodash's `isPlainObject()` correctly treats this as a plain object, but the `isPlainObject()` helper introduced in #936 does not. This broke our app, since we have a number of selectors which return prototypeless objects.

PR to follow.

Pull request:
Treat `null` as a valid plain object prototype in `isPlainObject()`
Fixes #1074

Patch:
diff --git a/src/utils/isPlainObject.js b/src/utils/isPlainObject.js
index 3560c2c..0c74b62 100644
--- a/src/utils/isPlainObject.js
+++ b/src/utils/isPlainObject.js
@@ -5,10 +5,13 @@
 export default function isPlainObject(obj) {
   if (typeof obj !== 'object' || obj === null) return false
 
-  let proto = obj
-  while (Object.getPrototypeOf(proto) !== null) {
-    proto = Object.getPrototypeOf(proto)
+  let proto = Object.getPrototypeOf(obj)
+  if (proto === null) return true
+
+  let baseProto = proto
+  while (Object.getPrototypeOf(baseProto) !== null) {
+    baseProto = Object.getPrototypeOf(baseProto)
   }
 
-  return Object.getPrototypeOf(obj) === proto
+  return proto === baseProto
 }


Test patch:
diff --git a/test/utils/isPlainObject.spec.js b/test/utils/isPlainObject.spec.js
index f8addd7..9b173f2 100644
--- a/test/utils/isPlainObject.spec.js
+++ b/test/utils/isPlainObject.spec.js
@@ -17,5 +17,6 @@ describe('isPlainObject', () => {
     expect(isPlainObject(null)).toBe(false)
     expect(isPlainObject()).toBe(false)
     expect(isPlainObject({ x: 1, y: 2 })).toBe(true)
+    expect(isPlainObject(Object.create(null))).toBe(true)
   })
 })
Repository: alicebob/miniredis (go)

Issue:
BLMOVE to the same single-element list causes TTL to be lost
This sequence of Redis commands:

```
LPUSH test 1
EXPIRE test 1000
TTL test  # outputs TTL > 0
BLMOVE test test LEFT LEFT 1
TTL test  # should continue outputting TTL > 0
```

works with Redis, but not Miniredis: The final `TTL test` in Miniredis will return -1, since I think blmove's implementation in Miniredis will cause Miniredis to delete and recreate the `test` list, losing the TTL in the process.

Pull request:
keep the TTL in BLMOVE
Fixes #402

Patch:
diff --git a/cmd_list.go b/cmd_list.go
index 0683ccc..d224275 100644
--- a/cmd_list.go
+++ b/cmd_list.go
@@ -1022,7 +1022,10 @@ func (m *Miniredis) cmdBlmove(c *server.Peer, cmd string, args []string) {
 				return true
 			}
 
-			var elem string
+			var (
+				elem string
+				ttl  = db.ttl[opts.src] // in case we empty the array (deletes the entry)
+			)
 			switch opts.srcDir {
 			case "left":
 				elem = db.listLpop(opts.src)
@@ -1042,6 +1045,9 @@ func (m *Miniredis) cmdBlmove(c *server.Peer, cmd string, args []string) {
 				c.WriteError(msgSyntaxError)
 				return true
 			}
+			if ttl > 0 {
+				db.ttl[opts.dst] = ttl
+			}
 
 			c.WriteBulk(elem)
 			return true


Test patch:
diff --git a/integration/list_test.go b/integration/list_test.go
index 8644b01..6164461 100644
--- a/integration/list_test.go
+++ b/integration/list_test.go
@@ -628,6 +628,13 @@ func TestBlmove(t *testing.T) {
 		c.Do("BLMOVE", "round", "round", "RIGHT", "RIGHT", "0")
 		c.Do("LRANGE", "round", "0", "-1")
 
+		// TTL
+		c.Do("LPUSH", "test", "1")
+		c.Do("EXPIRE", "test", "1000")
+		c.Do("TTL", "test")
+		c.Do("BLMOVE", "test", "test", "LEFT", "LEFT", "1")
+		c.Do("TTL", "test")
+
 		// failure cases
 		c.Do("RPUSH", "chk", "aap", "noot", "mies")
 		c.Error("wrong number", "LMOVE")
Repository: adamchainz/flake8-comprehensions (python)

Issue:
Add new rule for enumerate(<comprehension>)
Suggest change from `enumerate(<comprehension>)` to `enumerate(<generator>)` with the caveat that the generator needs to be wrapped in parentheses if [`enumerate()`](https://docs.python.org/3/library/functions.html#enumerate) is passed the `start` argument.

Pull request:
Added missing builtin enumerate to C407
Fixes #61. Thanks @pope1ni for the original PR in #108.

Patch:
diff --git a/HISTORY.rst b/HISTORY.rst
index 4083bad..e624a53 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -7,6 +7,8 @@ Pending Release
 
 .. Insert new release notes below this line
 
+* Add missing builtin ``enumerate`` to ``C407``.
+
 2.0.0 (2019-02-02)
 ------------------
 
diff --git a/README.rst b/README.rst
index 373a72d..94145a2 100644
--- a/README.rst
+++ b/README.rst
@@ -106,6 +106,7 @@ The list of builtins that are checked for are:
 
 * ``all``
 * ``any``
+* ``enumerate``
 * ``frozenset``
 * ``max``
 * ``min``
diff --git a/flake8_comprehensions.py b/flake8_comprehensions.py
index a8aa708..5496e83 100644
--- a/flake8_comprehensions.py
+++ b/flake8_comprehensions.py
@@ -126,7 +126,7 @@ class ComprehensionChecker(object):
                 elif (
                     n_args == 1 and
                     isinstance(node.args[0], ast.ListComp) and
-                    node.func.id in ('all', 'any', 'frozenset', 'max', 'min', 'sorted', 'sum', 'tuple')
+                    node.func.id in ('all', 'any', 'enumerate', 'frozenset', 'max', 'min', 'sorted', 'sum', 'tuple')
                 ):
 
                     yield (


Test patch:
diff --git a/test_flake8_comprehensions.py b/test_flake8_comprehensions.py
index 6a5135c..087b1e2 100644
--- a/test_flake8_comprehensions.py
+++ b/test_flake8_comprehensions.py
@@ -271,6 +271,16 @@ def test_C407_max_fail_1(flake8dir):
     ]
 
 
+def test_C407_enumerate_fail_1(flake8dir):
+    flake8dir.make_example_py("""
+        foo = enumerate([x for x in range(10)])
+    """)
+    result = flake8dir.run_flake8()
+    assert result.out_lines == [
+        "./example.py:1:7: C407 Unnecessary list comprehension - 'enumerate' can take a generator.",
+    ]
+
+
 def test_C407_tuple_pass_1(flake8dir):
     flake8dir.make_example_py("""
         foo = ()