PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: brenolf/polyjuice (js)

Issue:
Add `ArrowFunctions` rules
* http://jscs.info/rule/disallowArrowFunctions
* http://jscs.info/rule/requireArrowFunctions

Pull request:
Resolves #32

Patch:
diff --git a/lib/dictionaries/jscs.js b/lib/dictionaries/jscs.js
index b13ea30..ff0b0b3 100644
--- a/lib/dictionaries/jscs.js
+++ b/lib/dictionaries/jscs.js
@@ -781,6 +781,17 @@ module.exports = {
 
   'requireArrowFunctions': 'prefer-arrow-callback',
 
+  'disallowArrowFunctions': {
+    name: 'no-restricted-syntax',
+    truthy: function () {
+      var attrs = this.value || []
+
+      attrs.push('ArrowFunctionExpression')
+
+      return attrs
+    }
+  },
+
   'requireSpaceBeforePostfixUnaryOperators': {
     name: 'space-unary-ops',
     truthy: [2, { words: true, nonwords: true }]


Test patch:
diff --git a/test/dictionaries/jscs.test.js b/test/dictionaries/jscs.test.js
index f45d2fe..7be3461 100644
--- a/test/dictionaries/jscs.test.js
+++ b/test/dictionaries/jscs.test.js
@@ -612,4 +612,16 @@ describe('jscs', function () {
       }
     }])
   })
+
+  it('converts disallowArrowFunctions correctly', function () {
+    var fn = getFn('disallowArrowFunctions')
+
+    var fnBound = getFn('disallowArrowFunctions', [
+      'A', 'B'
+    ])
+
+    expect(fn('CLRF')).to.eql(['ArrowFunctionExpression'])
+
+    expect(fnBound('LF')).to.eql(['A', 'B', 'ArrowFunctionExpression'])
+  })
 })
Repository: ChristianMurphy/postcss-combine-duplicated-selectors (js)

Issue:
Node#moveTo was deprecated. Use Container#append.
Using 2.3.0.

Pull request:
Fix postcss deprecation warning about `moveTo`.
Fixes #93 

/CC @ChristianMurphy 

Patch:
diff --git a/src/index.js b/src/index.js
index ea301ac..dc115ff 100644
--- a/src/index.js
+++ b/src/index.js
@@ -99,7 +99,7 @@ module.exports = postcss.plugin(name, (options) => {
         const destination = map.get(selector);
         // move declarations to original rule
         while (rule.nodes.length > 0) {
-          rule.nodes[0].moveTo(destination);
+          destination.append(rule.nodes[0]);
         }
         // remove duplicated rule
         rule.remove();


Test patch:
diff --git a/test/duplicated-css.js b/test/duplicated-css.js
index cf29ce3..43cae87 100644
--- a/test/duplicated-css.js
+++ b/test/duplicated-css.js
@@ -210,7 +210,7 @@ test(
   'selectors with multiple properties',
   css,
   '.a {color: black; height: 10px} .a {background-color: red; width: 20px}',
-  '.a {color: black; height: 10px; background-color: red; width: 20px}'
+  '.a {color: black; height: 10px;background-color: red; width: 20px}'
 );
 
 test(
diff --git a/test/duplicated-properties.js b/test/duplicated-properties.js
index 2c8e11c..b55e812 100644
--- a/test/duplicated-properties.js
+++ b/test/duplicated-properties.js
@@ -17,7 +17,7 @@ test(
   'remove duplicated properties when combine selectors',
   removeDuplicates,
   '.a {height: 10px; color: black;} .a {color: blue; width: 20px;}',
-  '.a {height: 10px; color: blue; width: 20px;}'
+  '.a {height: 10px;color: blue; width: 20px;}'
 );
 
 test(
@@ -37,7 +37,7 @@ test(
   'maintain duplicated properties when combine selectors',
   keepDuplicates,
   '.a {height: 10px; color: black;} .a {color: blue; width: 20px;}',
-  '.a {height: 10px; color: black; color: blue; width: 20px;}'
+  '.a {height: 10px; color: black;color: blue; width: 20px;}'
 );
 
 test(
Repository: doctrine/dbal (php)

Issue:
QueryBuilder uses 1-based positional parameter keys
### Bug Report

|    Q        |   A
|------------ | ------
| BC Break    |no
| Version     | 2.12.1

#### Summary

According to the documentation,

https://github.com/doctrine/dbal/blob/84328cd947706210caebcaea3ca0394b3ebc4673/docs/en/reference/query-builder.rst#L47-L48

The usage of non-zero-based keys has been explicitly deprecated in https://github.com/doctrine/dbal/pull/4411. The issue was discovered during the work on https://github.com/doctrine/dbal/pull/4397 which enforces this deprecation. 

#### Current behaviour

When using `QueryBuilder::creartePositionalParameter()`, the keys are created starting from `1`.

#### How to reproduce

```php
$qb = $conn->createQueryBuilder();
$qb->select($qb->createPositionalParameter('FOO'));

var_dump($qb->getParameters());
// array(1) {
//   [1] =>
//   string(3) "FOO"
// }
```

#### Expected behaviour

```php
// array(1) {
//   [0] =>
//   string(3) "FOO"
// }
```


Pull request:
QueryBuilder must use 0-based positional parameter keys
|      Q       |   A
|------------- | -----------
| Type         | bug
| BC Break     | no

Fixes #4421.

Although this bug exists in `2.x`, I don't think we have to fix it in a patch release. It's sufficient to fix it in `3.0.x`.

Patch:
diff --git a/src/Query/QueryBuilder.php b/src/Query/QueryBuilder.php
index 89dc2efde..c8bf98149 100644
--- a/src/Query/QueryBuilder.php
+++ b/src/Query/QueryBuilder.php
@@ -1330,8 +1330,8 @@ class QueryBuilder
      */
     public function createPositionalParameter($value, $type = ParameterType::STRING)
     {
-        $this->boundCounter++;
         $this->setParameter($this->boundCounter, $value, $type);
+        $this->boundCounter++;
 
         return '?';
     }


Test patch:
diff --git a/tests/Query/QueryBuilderTest.php b/tests/Query/QueryBuilderTest.php
index 9f81d36fd..d3574b6d0 100644
--- a/tests/Query/QueryBuilderTest.php
+++ b/tests/Query/QueryBuilderTest.php
@@ -679,8 +679,8 @@ class QueryBuilderTest extends TestCase
         );
 
         self::assertEquals('SELECT u.* FROM users u WHERE u.name = ?', (string) $qb);
-        self::assertEquals(10, $qb->getParameter(1));
-        self::assertEquals(ParameterType::INTEGER, $qb->getParameterType(1));
+        self::assertEquals(10, $qb->getParameter(0));
+        self::assertEquals(ParameterType::INTEGER, $qb->getParameterType(0));
     }
 
     public function testReferenceJoinFromJoin(): void
Repository: pinojs/hapi-pino (js)

Issue:
Not handling correctly `request.url` being undefined
Starting with Hapi@18, all extensions on the`onRequest` event need to handle that [`request.url` might be undefined](https://github.com/hapijs/hapi/issues/3871).

> if you have onRequest extension handlers, make sure your code can handle request.url being set to null if the request.path received is invalid.

We recently had a problem with hapi-pino, because the `isLoggingIgnored` functions threw a type error.

```javascript
  function isLoggingIgnored (options, request) {
   // request.url can be undefined at this point;
    if (options.ignorePaths && ignoreTable[request.url.pathname]) {
      return true
    }
```

Pull request:
[master] fix: get securely pathname from request url
Fixes #102 

Patch:
diff --git a/index.js b/index.js
index 5937b6e..41bf6d5 100644
--- a/index.js
+++ b/index.js
@@ -172,7 +172,8 @@ async function register (server, options) {
   })
 
   function isLoggingIgnored (options, request) {
-    if (options.ignorePaths && ignoreTable[request.url.pathname]) {
+    // note: from hapi@18.0.0 the `request.url` can be undefined
+    if (options.ignorePaths && request.url && ignoreTable[request.url.pathname]) {
       return true
     }
 


Test patch:
diff --git a/test.js b/test.js
index 4ae7ea2..8c02026 100644
--- a/test.js
+++ b/test.js
@@ -1458,6 +1458,38 @@ experiment('logging with request payload', () => {
   })
 })
 
+experiment('logging with invalid request', () => {
+  test('registered with ignored path and invalid injected', async () => {
+    const server = getServer()
+    let resolver
+    const done = new Promise((resolve, reject) => {
+      resolver = resolve
+    })
+    const stream = sink(data => {
+      expect(data.req.url).to.be.undefined()
+      resolver()
+    })
+    const logger = require('pino')(stream)
+    const plugin = {
+      plugin: Pino,
+      options: {
+        instance: logger,
+        ignorePaths: ['/ignored']
+      }
+    }
+
+    await server.register(plugin)
+
+    await server.inject({
+      method: 'PUT',
+      url: '/ignored'
+    })
+
+    await server.inject('invalid')
+    await done
+  })
+})
+
 experiment('ignore request logs for paths in ignorePaths', () => {
   test('when path matches entry in ignorePaths, nothing should be logged', async () => {
     const server = getServer()
Repository: django-extensions/django-extensions (python)

Issue:
RemovedInDjango41Warning: 'django_extensions' defines default_app_config
The following warning is emitted when using django-extenstions along with django 3.2
```
django.utils.deprecation.RemovedInDjango41Warning: 'django_extensions' defines default_app_config = 'django_extensions.apps.DjangoExtensionsConfig'. Django now detects this configuration automatically. You can remove default_app_config.
```

I suppose it is related to the change introduced by django 3.2: https://docs.djangoproject.com/en/3.2/releases/3.2/#what-s-new-in-django-3-2

Environment:
* python 3.8
* django 3.2


Pull request:
fix: Handle warnings for default_app_config
- they are only defined for django versions < 3.2

closes #1649

Patch:
diff --git a/django_extensions/__init__.py b/django_extensions/__init__.py
index 488c8e0d..8e1d2201 100644
--- a/django_extensions/__init__.py
+++ b/django_extensions/__init__.py
@@ -19,4 +19,11 @@ def get_version(version):
 
 __version__ = get_version(VERSION)
 
-default_app_config = 'django_extensions.apps.DjangoExtensionsConfig'
+try:
+    import django
+
+    if django.VERSION < (3, 2):
+        default_app_config = 'django_extensions.apps.DjangoExtensionsConfig'
+except ModuleNotFoundError:
+    # this part is useful for allow setup.py to be used for version checks
+    pass


Test patch:
diff --git a/tests/management/commands/test_notes.py b/tests/management/commands/test_notes.py
index cfe7536e..8536743c 100644
--- a/tests/management/commands/test_notes.py
+++ b/tests/management/commands/test_notes.py
@@ -8,7 +8,7 @@ def test_without_args(capsys, settings):
     call_command('notes')
 
     out, err = capsys.readouterr()
-    assert 'tests/testapp/__init__.py:\n  * [  4] TODO  this is a test todo\n\n' in out
+    assert 'tests/testapp/__init__.py:\n  * [  8] TODO  this is a test todo\n\n' in out
 
 
 def test_with_utf8(capsys, settings):
diff --git a/tests/test_compatibility.py b/tests/test_compatibility.py
new file mode 100644
index 00000000..703fb8ee
--- /dev/null
+++ b/tests/test_compatibility.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+"""Test Compatility between different django versions"""
+import django
+import pytest
+
+import django_extensions
+
+
+class TestDefaultAppConfigDefinition:
+    @pytest.mark.skipif(django.VERSION < (3, 2), reason='app config is automatically defined by django')
+    def test_app_config_not_defined(self):
+        assert hasattr(django_extensions, 'default_app_config') is False
+
+    @pytest.mark.skipif(django.VERSION >= (3, 2), reason='app config is  not automatically defined by django')
+    def test_app_config_defined(self):
+        assert hasattr(django_extensions, 'default_app_config') is True
diff --git a/tests/testapp/__init__.py b/tests/testapp/__init__.py
index 0599a078..b889f41b 100644
--- a/tests/testapp/__init__.py
+++ b/tests/testapp/__init__.py
@@ -1,4 +1,8 @@
 # -*- coding: utf-8 -*-
-default_app_config = 'tests.testapp.apps.TestAppConfig'
+import django
+
+
+if django.VERSION < (3, 2):
+    default_app_config = 'tests.testapp.apps.TestAppConfig'
 
 # TODO: this is a test todo