PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: SebRut/pygrocy (python)

Issue:
Add path in request when creating base url
If grocy in not host at the root of a web server but in an other directory every request failed due to the base_url not complete.
This is done in line https://github.com/SebRut/pygrocy/blob/8787acc6d4f5f16169894810e21ba09b0b4f831d/pygrocy/grocy_api_client.py#L294

In this case the port may be add behind a full path like http://grocy.localdomain/grocy/public/:80/api/stock
Wich can't be available.

Pull request:
support path for url
fixes #121 

Patch:
diff --git a/pygrocy/grocy.py b/pygrocy/grocy.py
index ed5a5f9..cd1a559 100644
--- a/pygrocy/grocy.py
+++ b/pygrocy/grocy.py
@@ -36,10 +36,13 @@ class Grocy(object):
         base_url,
         api_key,
         port: int = DEFAULT_PORT_NUMBER,
+        path: str = None,
         verify_ssl=True,
         debug=False,
     ):
-        self._api_client = GrocyApiClient(base_url, api_key, port, verify_ssl, debug)
+        self._api_client = GrocyApiClient(
+            base_url, api_key, port, path, verify_ssl, debug
+        )
 
         if debug:
             _LOGGER.setLevel(logging.DEBUG)
diff --git a/pygrocy/grocy_api_client.py b/pygrocy/grocy_api_client.py
index ddf4ddb..8999160 100644
--- a/pygrocy/grocy_api_client.py
+++ b/pygrocy/grocy_api_client.py
@@ -233,13 +233,17 @@ class GrocyApiClient(object):
         base_url,
         api_key,
         port: int = DEFAULT_PORT_NUMBER,
+        path: str = None,
         verify_ssl=True,
         debug=False,
     ):
         if debug:
             _enable_debug_mode()
 
-        self._base_url = "{}:{}/api/".format(base_url, port)
+        if path:
+            self._base_url = "{}:{}/{}/api/".format(base_url, port, path)
+        else:
+            self._base_url = "{}:{}/api/".format(base_url, port)
         _LOGGER.debug(f"generated base url: {self._base_url}")
 
         self._api_key = api_key


Test patch:
diff --git a/test/test_grocy_api_client.py b/test/test_grocy_api_client.py
new file mode 100644
index 0000000..4b7f311
--- /dev/null
+++ b/test/test_grocy_api_client.py
@@ -0,0 +1,23 @@
+from pygrocy.grocy_api_client import GrocyApiClient
+
+
+class TestGrocyApiClient:
+    def test_url_only(self):
+        client = GrocyApiClient(api_key="", base_url="http://grocy.de")
+        assert client._base_url == "http://grocy.de:9192/api/"
+
+    def test_url_and_port(self):
+        client = GrocyApiClient(api_key="", base_url="http://grocy.de", port=1234)
+        assert client._base_url == "http://grocy.de:1234/api/"
+
+    def test_url_and_port_and_path(self):
+        client = GrocyApiClient(
+            api_key="", base_url="http://grocy.de", port=1234, path="my/custom/path"
+        )
+        assert client._base_url == "http://grocy.de:1234/my/custom/path/api/"
+
+    def test_url_and_path(self):
+        client = GrocyApiClient(
+            api_key="", base_url="http://grocy.de", path="my/custom/path"
+        )
+        assert client._base_url == "http://grocy.de:9192/my/custom/path/api/"
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 9
Good morning! Here's your coding interview problem for today.

This problem was asked by Airbnb.

Given a list of integers, write a function that returns the largest sum of non-adjacent numbers. Numbers can be 0 or negative.

For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5] should return 10, since we pick 5 and 5.

Follow-up: Can you do this in O(N) time and constant space?

Pull request:
Day9
Resolves #19 

Patch:
diff --git a/README.md b/README.md
index 116080e..6f4b50b 100644
--- a/README.md
+++ b/README.md
@@ -18,3 +18,4 @@ problems from
 * [Day 6](https://github.com/vaskoz/dailycodingproblem-go/issues/13)
 * [Day 7](https://github.com/vaskoz/dailycodingproblem-go/issues/15)
 * [Day 8](https://github.com/vaskoz/dailycodingproblem-go/issues/17)
+* [Day 9](https://github.com/vaskoz/dailycodingproblem-go/issues/19)
diff --git a/day9/problem.go b/day9/problem.go
new file mode 100644
index 0000000..d5af376
--- /dev/null
+++ b/day9/problem.go
@@ -0,0 +1,26 @@
+package day9
+
+// MaximumNonAdjacentSum calculates the largest possible sum without using adjacent values.
+// Runs in O(N) time and O(1) space.
+func MaximumNonAdjacentSum(nums []int) int {
+	var one, two, result int
+	for i, val := range nums {
+		if i == 0 {
+			result = val
+		} else if i == 1 {
+			result = max(result, val)
+		} else {
+			result = max(one, val+two)
+		}
+		two = one
+		one = result
+	}
+	return result
+}
+
+func max(a, b int) int {
+	if a > b {
+		return a
+	}
+	return b
+}


Test patch:
diff --git a/day9/problem_test.go b/day9/problem_test.go
new file mode 100644
index 0000000..0c7cb21
--- /dev/null
+++ b/day9/problem_test.go
@@ -0,0 +1,28 @@
+package day9
+
+import "testing"
+
+var testcases = []struct {
+	input    []int
+	expected int
+}{
+	{[]int{2, 4, 6, 2, 5}, 13},
+	{[]int{5, 1, 1, 5}, 10},
+	{[]int{10, 1}, 10},
+}
+
+func TestMaximumNonAdjacentSum(t *testing.T) {
+	for _, tc := range testcases {
+		if result := MaximumNonAdjacentSum(tc.input); result != tc.expected {
+			t.Errorf("Expected %v, but got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkMaximumNonAdjacentSum(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MaximumNonAdjacentSum(tc.input)
+		}
+	}
+}
Repository: Materials-Consortia/optimade-python-tools (python)

Issue:
Hill notation wrong (still)
Actual definition:
- If carbon is present, place it first, then hydrogen if present.
- Following hydrogen, sort elements alphabetically.
- If carbon is _not_ present, sort elements alphabetically, also if hydrogen is present.

Example of valid Hill notation formulas:
- C H<sub>4</sub> Cl O
- Cl H<sub>4</sub> O
- C Cl O

Incorrect Hill notation:
- H<sub>4</sub> Cl O

(See, e.g., the [wikipedia entry](https://en.wikipedia.org/wiki/Chemical_formula#Hill_system) for Hill notation.)

Pull request:
Check for carbon in elements for Hill
Fixes #585.

If carbon is not present, the elements should be sorted alphabetically (including hydrogen).

This changes a test to the corrected definition of Hill notation.

Patch:
diff --git a/optimade/models/structures.py b/optimade/models/structures.py
index e1aebb19..82ad7f1c 100644
--- a/optimade/models/structures.py
+++ b/optimade/models/structures.py
@@ -774,11 +774,12 @@ The properties of the species are found in the property `species`.
         expected_elements = sorted(elements)
 
         if field.name == "chemical_formula_hill":
-            # Make sure C is first and H is second.
-            for elem in ("H", "C"):
-                if elem in expected_elements:
-                    expected_elements.pop(expected_elements.index(elem))
-                    expected_elements.insert(0, elem)
+            # Make sure C is first (and H is second, if present along with C).
+            if "C" in expected_elements:
+                expected_elements = sorted(
+                    expected_elements,
+                    key=lambda elem: {"C": "0", "H": "1"}.get(elem, elem),
+                )
 
         if any(elem not in CHEMICAL_SYMBOLS for elem in elements):
             raise ValueError(


Test patch:
diff --git a/tests/models/test_structures.py b/tests/models/test_structures.py
index 1a6b8b56..2828c608 100644
--- a/tests/models/test_structures.py
+++ b/tests/models/test_structures.py
@@ -80,8 +80,8 @@ deformities = (
         "Elements in 'chemical_formula_hill' must appear in Hill order: ['Ge', 'Si'] not ['Si', 'Ge']",
     ),
     (
-        {"chemical_formula_hill": "GeHSi"},
-        "Elements in 'chemical_formula_hill' must appear in Hill order: ['H', 'Ge', 'Si'] not ['Ge', 'H', 'Si']",
+        {"chemical_formula_hill": "HGeSi"},
+        "Elements in 'chemical_formula_hill' must appear in Hill order: ['Ge', 'H', 'Si'] not ['H', 'Ge', 'Si']",
     ),
     (
         {"chemical_formula_hill": "CGeHSi"},
Repository: doctrine/dbal (php)

Issue:
BC Break after removing method \Doctrine\DBAL\Driver\PDOConnection::quote
The problem appeared in releases 2.10.3 [commit](https://github.com/doctrine/dbal/pull/3287/commits/85bc13deb0abbbf3a99347ab9b757c8c1a1ebd96)

The problem is that now, with strict mode enabled, nothing but string cannot be passed to \Doctrine\DBAL\Driver\PDOConnection::quote. These changes break backward compatibility and should not have been recorded as minor changes.



Pull request:
Restore PDOStatement::quote() for backward compatibility
Fixes #4281.

Patch:
diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php
index 43b8280ef..8409952cb 100644
--- a/lib/Doctrine/DBAL/Driver/PDOConnection.php
+++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php
@@ -5,6 +5,7 @@ namespace Doctrine\DBAL\Driver;
 use Doctrine\DBAL\Driver\Connection as ConnectionInterface;
 use Doctrine\DBAL\Driver\PDO\Exception;
 use Doctrine\DBAL\Driver\PDO\Statement;
+use Doctrine\DBAL\ParameterType;
 use PDO;
 use PDOException;
 use PDOStatement;
@@ -101,6 +102,14 @@ class PDOConnection extends PDO implements ConnectionInterface, ServerInfoAwareC
         }
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function quote($value, $type = ParameterType::STRING)
+    {
+        return parent::quote($value, $type);
+    }
+
     /**
      * {@inheritdoc}
      */
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index c82ca439e..8c6b82da6 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -110,6 +110,11 @@
         <exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
     </rule>
 
+    <!-- The override opts out the caller from the strict mode for backward compatibility -->
+    <rule ref="Generic.CodeAnalysis.UselessOverridingMethod.Found">
+        <exclude-pattern>lib/Doctrine/DBAL/Driver/PDOConnection.php</exclude-pattern>
+    </rule>
+
     <!-- See https://github.com/slevomat/coding-standard/issues/770 -->
     <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
         <exclude-pattern>lib/Doctrine/DBAL/Driver/ExceptionConverterDriver.php</exclude-pattern>


Test patch:
diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php
index f54cb07b0..c9f748fbc 100644
--- a/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php
+++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/PDO/ConnectionTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace Doctrine\Tests\DBAL\Functional\Driver\PDO;
 
 use Doctrine\DBAL\Driver\PDO\Connection;
@@ -100,4 +102,12 @@ class ConnectionTest extends DbalFunctionalTestCase
 
         $this->driverConnection->query('foo');
     }
+
+    /**
+     * This test ensures backward compatibility with DBAL 2.x and should be removed in 3.0.
+     */
+    public function testQuoteInteger(): void
+    {
+        self::assertSame("'1'", $this->connection->getWrappedConnection()->quote(1));
+    }
 }