nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: Scille/umongo
Pull request #200 (2019-06-12 14:14:17)

Let Reference and GenericReference round-trip
Marshmallow bonus `Reference` field does not round-trip.

It works if the data is loaded then passed to a `Document` then the document is dumped.

```py
loaded_data = Schema().load(data)
loaded_data['ref']  # ObjectId
doc = Document(**loaded_data)
doc.ref  # Reference
dumped_data = Schema().dump(doc)
dumped_data  # string
```

But it fails if the data is never passed to a document init: the `Reference` field serialization method expects a `Reference` data object, not an `ObjectId`.

```py
data['ref']  # string
loaded_data = Schema().load(data)
loaded_data['ref']  # ObjectId
dumped_data = Schema().dump(loaded_data)  # fails
```

Same with `GenericReference` field.

This PR allows to load then dump references without instantiating an object.


Patch:
diff --git a/umongo/marshmallow_bonus.py b/umongo/marshmallow_bonus.py
index 55ad3b7..669c6b7 100644
--- a/umongo/marshmallow_bonus.py
+++ b/umongo/marshmallow_bonus.py
@@ -149,6 +149,9 @@ class Reference(ObjectId):
             return str(value)
         else:
             # In OO world, value is a :class:`umongo.data_object.Reference`
+            # or an ObjectId before being loaded into a Document
+            if isinstance(value, bson.ObjectId):
+                return str(value)
             return str(value.pk)
 
 
@@ -169,6 +172,9 @@ class GenericReference(ma_fields.Field):
             return {'id': str(value['_id']), 'cls': value['_cls']}
         else:
             # In OO world, value is a :class:`umongo.data_object.Reference`
+            # or a dict before being loaded into a Document
+            if isinstance(value, dict):
+                return {'id': str(value['id']), 'cls': value['cls']}
             return {'id': str(value.pk), 'cls': value.document_cls.__name__}
 
     def _deserialize(self, value, attr, data):


Test patch:
diff --git a/tests/test_marshmallow.py b/tests/test_marshmallow.py
index 918ea74..ec8a9ca 100644
--- a/tests/test_marshmallow.py
+++ b/tests/test_marshmallow.py
@@ -432,9 +432,15 @@ class TestMarshmallow(BaseTest):
         # schema to OO world
         ma_schema_cls = Doc.schema.as_marshmallow_schema()
         ma_schema = ma_schema_cls()
+        # Dump uMongo object
         ret = ma_schema.dump(doc)
         assert not ret.errors
         assert ret.data == serialized
+        # Dump OO data (not uMongo object) to ensure bonus fields round-trip
+        ret = ma_schema.dump(oo_data)
+        assert not ret.errors
+        assert ret.data == serialized
+        # Load serialized data
         ret = ma_schema.load(serialized)
         assert not ret.errors
         assert ret.data == oo_data
Repository: Scille/umongo
Pull request #207 (2019-10-04 13:19:00)

ObjectId bonus field: catch TypeError when deserializing


Patch:
diff --git a/umongo/marshmallow_bonus.py b/umongo/marshmallow_bonus.py
index 669c6b7..f4c5465 100644
--- a/umongo/marshmallow_bonus.py
+++ b/umongo/marshmallow_bonus.py
@@ -128,7 +128,7 @@ class ObjectId(ma_fields.Field):
     def _deserialize(self, value, attr, data):
         try:
             return bson.ObjectId(value)
-        except bson.errors.InvalidId:
+        except (TypeError, bson.errors.InvalidId):
             raise ValidationError(_('Invalid ObjectId.'))
 
 


Test patch:
diff --git a/tests/test_marshmallow.py b/tests/test_marshmallow.py
index ec8a9ca..74dc103 100644
--- a/tests/test_marshmallow.py
+++ b/tests/test_marshmallow.py
@@ -458,6 +458,24 @@ class TestMarshmallow(BaseTest):
         ret = ma_mongo_schema.load({"gen_ref": {'_cls': 'Doc', '_id': "57c1a71113adf27ab96b2c4f"}})
         assert ret.errors == {'gen_ref': ['Generic reference must have `id` and `cls` fields.']}
 
+    def test_marshmallow_bonus_objectid_field(self):
+
+        class DocSchema(marshmallow.Schema):
+            id = ma_bonus_fields.ObjectId()
+
+            class Meta:
+                strict = True
+
+        schema = DocSchema()
+
+        assert schema.load({"id": "57c1a71113adf27ab96b2c4f"}).data == {
+            "id": ObjectId("57c1a71113adf27ab96b2c4f")}
+
+        for invalid_id in ("lol", [1, 2], {"1", 2}):
+            with pytest.raises(marshmallow.ValidationError) as exc:
+                schema.load({"id": invalid_id})
+            assert exc.value.messages == {"id": ["Invalid ObjectId."]}
+
     def test_marshmallow_schema_helpers(self):
 
         class CheckUnknownSchema(marshmallow.Schema):
Repository: Scille/umongo
Pull request #253 (2020-04-25 21:25:11)

Don't modify data proxy on partial not loaded access
Before this fix, `set_by_mongo_name` would raise but modify the data.


Patch:
diff --git a/umongo/data_proxy.py b/umongo/data_proxy.py
index ac3ec57..a7c7421 100644
--- a/umongo/data_proxy.py
+++ b/umongo/data_proxy.py
@@ -109,15 +109,14 @@ class BaseDataProxy:
         self._add_missing_fields()
 
     def get_by_mongo_name(self, name):
-        value = self._data[name]
         if self._fields_from_mongo_key[name] in self.not_loaded_fields:
             raise FieldNotLoadedError(name)
-        return value
+        return self._data[name]
 
     def set_by_mongo_name(self, name, value):
-        self._data[name] = value
         if self._fields_from_mongo_key[name] in self.not_loaded_fields:
             raise FieldNotLoadedError(name)
+        self._data[name] = value
         self._mark_as_modified(name)
 
     def delete_by_mongo_name(self, name):


Test patch:
diff --git a/tests/test_data_proxy.py b/tests/test_data_proxy.py
index ee053fa..2cf8d6a 100644
--- a/tests/test_data_proxy.py
+++ b/tests/test_data_proxy.py
@@ -379,12 +379,27 @@ class TestDataProxy(BaseTest):
         d.from_mongo({'loaded': "foo", 'loaded_but_empty': missing}, partial=True)
         assert d.partial is True
         for field in ('with_default', 'normal'):
+            val = d._data[field]
             with pytest.raises(exceptions.FieldNotLoadedError):
                 d.get(field)
+            assert d._data[field] == val
             with pytest.raises(exceptions.FieldNotLoadedError):
                 d.set(field, "test")
+            assert d._data[field] == val
             with pytest.raises(exceptions.FieldNotLoadedError):
                 d.delete(field)
+            assert d._data[field] == val
+        for field in ('normal', 'in_mongo_field'):
+            val = d._data[field]
+            with pytest.raises(exceptions.FieldNotLoadedError):
+                d.get_by_mongo_name(field)
+            assert d._data[field] == val
+            with pytest.raises(exceptions.FieldNotLoadedError):
+                d.set_by_mongo_name(field, "test")
+            assert d._data[field] == val
+            with pytest.raises(exceptions.FieldNotLoadedError):
+                d.delete_by_mongo_name(field)
+            assert d._data[field] == val
         assert d.get('loaded') == "foo"
         assert d.get('loaded_but_empty') is missing
         d.set('loaded_but_empty', "bar")
Repository: mattn/go-sqlite3
Pull request #738 (2019-08-22 10:38:03)

Issue #733 Fix memory leak in ExpandedSQL
Fixes: #733

GJRTimmer: @gwenn Awaiting test result of branch `fix-733`
@mattn Please Review
coveralls: 
[![Coverage Status](https://coveralls.io/builds/25284055/badge)](https://coveralls.io/builds/25284055)

Coverage remained the same at 50.381% when pulling **b67a21c39e405140cc5c896e0ff20bc607fc306f on fix-733** into **2ea5857c0eb3179b078ce5fb881ace11eb28f285 on master**.


Patch:
diff --git a/sqlite3.go b/sqlite3.go
index 5ef56ad..4000173 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -1522,10 +1522,10 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
 		// Before going any further, we need to check that the user
 		// has provided an username and password within the DSN.
 		// We are not allowed to continue.
-		if len(authUser) < 0 {
+		if len(authUser) == 0 {
 			return nil, fmt.Errorf("Missing '_auth_user' while user authentication was requested with '_auth'")
 		}
-		if len(authPass) < 0 {
+		if len(authPass) == 0 {
 			return nil, fmt.Errorf("Missing '_auth_pass' while user authentication was requested with '_auth'")
 		}
 
diff --git a/sqlite3_trace.go b/sqlite3_trace.go
index ee93a0f..51cb22e 100644
--- a/sqlite3_trace.go
+++ b/sqlite3_trace.go
@@ -89,6 +89,7 @@ func fillExpandedSQL(info *TraceInfo, db *C.sqlite3, pStmt unsafe.Pointer) {
 	}
 
 	expSQLiteCStr := C.sqlite3_expanded_sql((*C.sqlite3_stmt)(pStmt))
+	defer C.sqlite3_free(unsafe.Pointer(expSQLiteCStr))
 	if expSQLiteCStr == nil {
 		fillDBError(&info.DBError, db)
 		return


Test patch:
diff --git a/sqlite3_opt_userauth_test.go b/sqlite3_opt_userauth_test.go
index df65215..543f48e 100644
--- a/sqlite3_opt_userauth_test.go
+++ b/sqlite3_opt_userauth_test.go
@@ -60,7 +60,14 @@ func init() {
 			file = TempFilename(t)
 		}
 
-		db, err = sql.Open("sqlite3_with_conn", "file:"+file+fmt.Sprintf("?_auth&_auth_user=%s&_auth_pass=%s", username, password))
+		params := "?_auth"
+		if len(username) > 0 {
+			params = fmt.Sprintf("%s&_auth_user=%s", params, username)
+		}
+		if len(password) > 0 {
+			params = fmt.Sprintf("%s&_auth_pass=%s", params, password)
+		}
+		db, err = sql.Open("sqlite3_with_conn", "file:"+file+params)
 		if err != nil {
 			defer os.Remove(file)
 			return file, nil, nil, err
@@ -164,6 +171,23 @@ func TestUserAuthCreateDatabase(t *testing.T) {
 	}
 }
 
+func TestUserAuthCreateDatabaseWithoutArgs(t *testing.T) {
+	_, db, c, err := connect(t, "", "", "")
+	if err == nil && c == nil && db == nil {
+		t.Fatal("Should have failed due to missing _auth_* parameters")
+	}
+
+	_, db, c, err = connect(t, "", "", "admin")
+	if err == nil && c == nil && db == nil {
+		t.Fatal("Should have failed due to missing _auth_user parameter")
+	}
+
+	_, db, c, err = connect(t, "", "admin", "")
+	if err == nil && c == nil && db == nil {
+		t.Fatal("Should have failed due to missing _auth_pass parameter")
+	}
+}
+
 func TestUserAuthLogin(t *testing.T) {
 	f1, err := create(t, "admin", "admin")
 	if err != nil {
Repository: mattn/go-sqlite3
Pull request #883 (2020-11-16 15:57:59)

sqlite3_test.go: Move Go 1.13 test to sqlite3_go113_test.go
Commit 4f7abea96e added a test that uses Conn.Raw, which was added in
Go >= 1.13. The go-sqlite3 project runs tests with Go >= 1.11. Remove
the test from sqlite3_test.go, so it only runs with the correct
versions of Go.

Instead of adding a new test, modify the existing test that already
uses Conn.Raw() to check the type of driverConn.

Fixes issue from #882 

mattn: Thank you! I'll merge after CI pass.
evanj: The Windows failure is: ```--- FAIL: TestExecContextCancel (57.89s)
    sqlite3_go18_test.go:170: 1000000 <nil> 26.4808527s
    sqlite3_go18_test.go:173: <nil> context deadline exceeded``` which might be helped by #879 . The Mac failure is the one that is always happening on Mac OS X with 1.11 due to some dependency issue that I haven't looked at.

I hope I did this correctly this time! 😄  thank you!



Patch:
diff --git a/doc.go b/doc.go
index 7a4fb6d..ac27633 100644
--- a/doc.go
+++ b/doc.go
@@ -90,7 +90,7 @@ ConnectHook to get the SQLiteConn.
 					},
 			})
 
-You can also use database/sql.Conn.Raw:
+You can also use database/sql.Conn.Raw (Go >= 1.13):
 
 	conn, err := db.Conn(context.Background())
 	// if err != nil { ... }


Test patch:
diff --git a/sqlite3_go113_test.go b/sqlite3_go113_test.go
index 74036f8..6f74e6b 100644
--- a/sqlite3_go113_test.go
+++ b/sqlite3_go113_test.go
@@ -49,6 +49,10 @@ func TestBeginTxCancel(t *testing.T) {
 				if !ok {
 					t.Fatal("unexpected: wrong type")
 				}
+				// checks that conn.Raw can be used to get *SQLiteConn
+				if _, ok = driverConn.(*SQLiteConn); !ok {
+					t.Fatalf("conn.Raw() driverConn type=%T, expected *SQLiteConn", driverConn)
+				}
 
 				go cancel() // make it cancel concurrently with exec("BEGIN");
 				tx, err := d.BeginTx(ctx, driver.TxOptions{})
diff --git a/sqlite3_test.go b/sqlite3_test.go
index fe367cf..d5b0cea 100644
--- a/sqlite3_test.go
+++ b/sqlite3_test.go
@@ -9,7 +9,6 @@ package sqlite3
 
 import (
 	"bytes"
-	"context"
 	"database/sql"
 	"database/sql/driver"
 	"errors"
@@ -2353,32 +2352,3 @@ func benchmarkStmtRows(b *testing.B) {
 		}
 	}
 }
-
-func TestConnRawIsSQLiteConn(t *testing.T) {
-	db, err := sql.Open("sqlite3", ":memory:")
-	if err != nil {
-		t.Fatal("Failed to open db:", err)
-	}
-	defer db.Close()
-
-	conn, err := db.Conn(context.Background())
-	if err != nil {
-		t.Fatal("Failed to get conn:", err)
-	}
-	defer conn.Close()
-	err = conn.Raw(func(driverConn interface{}) error {
-		sqliteConn, ok := driverConn.(*SQLiteConn)
-		if !ok {
-			t.Errorf("driverConn type=%T; expected to be *SQLiteConn", driverConn)
-			return nil
-		}
-		// call a private SQLite API to confirm the raw conn "works"
-		if sqliteConn.AuthEnabled() {
-			t.Error("sqliteConn.AuthEnabled()=true; expected false")
-		}
-		return nil
-	})
-	if err != nil {
-		t.Error("conn.Raw() returned err:", err)
-	}
-}
Repository: mattn/go-sqlite3
Pull request #1079 (2022-08-29 15:52:01)

Fix test queryer test
This fixes the TestQueryer test to exec for the multistatement insertion, as well as fixing the value of n

joshbuddy: @rittneje @mattn I've made those changes

Patch:
diff --git a/README.md b/README.md
index 58e315a..518cd0b 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 go-sqlite3
 ==========
 
-[![GoDoc Reference](https://godoc.org/github.com/mattn/go-sqlite3?status.svg)](http://godoc.org/github.com/mattn/go-sqlite3)
+[![Go Reference](https://pkg.go.dev/badge/github.com/mattn/go-sqlite3.svg)](https://pkg.go.dev/github.com/mattn/go-sqlite3)
 [![GitHub Actions](https://github.com/mattn/go-sqlite3/workflows/Go/badge.svg)](https://github.com/mattn/go-sqlite3/actions?query=workflow%3AGo)
 [![Financial Contributors on Open Collective](https://opencollective.com/mattn-go-sqlite3/all/badge.svg?label=financial+contributors)](https://opencollective.com/mattn-go-sqlite3) 
 [![codecov](https://codecov.io/gh/mattn/go-sqlite3/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-sqlite3)


Test patch:
diff --git a/sqlite3_test.go b/sqlite3_test.go
index d948378..33d03fd 100644
--- a/sqlite3_test.go
+++ b/sqlite3_test.go
@@ -1063,36 +1063,44 @@ func TestQueryer(t *testing.T) {
 	defer db.Close()
 
 	_, err = db.Exec(`
-	create table foo (id integer);
+		create table foo (id integer);
 	`)
 	if err != nil {
 		t.Error("Failed to call db.Query:", err)
 	}
 
-	rows, err := db.Query(`
-	insert into foo(id) values(?);
-	insert into foo(id) values(?);
-	insert into foo(id) values(?);
-	select id from foo order by id;
+	_, err = db.Exec(`
+		insert into foo(id) values(?);
+		insert into foo(id) values(?);
+		insert into foo(id) values(?);
 	`, 3, 2, 1)
+	if err != nil {
+		t.Error("Failed to call db.Exec:", err)
+	}
+	rows, err := db.Query(`
+		select id from foo order by id;
+	`)
 	if err != nil {
 		t.Error("Failed to call db.Query:", err)
 	}
 	defer rows.Close()
-	n := 1
+	n := 0
 	for rows.Next() {
 		var id int
 		err = rows.Scan(&id)
 		if err != nil {
 			t.Error("Failed to db.Query:", err)
 		}
-		if id != n {
+		if id != n + 1 {
 			t.Error("Failed to db.Query: not matched results")
 		}
 		n = n + 1
 	}
+	if err := rows.Err(); err != nil {
+		t.Errorf("Post-scan failed: %v\n", err)
+	}
 	if n != 3 {
-		t.Errorf("Expected 3 rows but retrieved %v", n-1)
+		t.Errorf("Expected 3 rows but retrieved %v", n)
 	}
 }
Repository: redis/redis-py
Pull request #3550 (2025-03-07 16:20:01)

Exponential with jitter backoff
### Pull Request check-list

_Please make sure to review and check all of these items:_

- [ ] Do tests and lints pass with this change?
- [ ] Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
- [ ] Is the new or changed code fully tested?
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
- [ ] Is there an example added to the examples folder (if applicable)?
- [ ] Was the change added to CHANGES file?

_NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open._

### Description of change

Add a new backoff class for a simple exponential backoff with jitter.


petyaslavova: Hi @JimNero009, thank you for your contribution! We’ll review your change soon.
petyaslavova: Hi @JimNero009, can you please add unit tests to your change? 
JimNero009: @petyaslavova sure! I've added something that makes _some_ sense now, how's that? 

Patch:
diff --git a/redis/backoff.py b/redis/backoff.py
index f612d607..e236764d 100644
--- a/redis/backoff.py
+++ b/redis/backoff.py
@@ -110,5 +110,20 @@ class DecorrelatedJitterBackoff(AbstractBackoff):
         return self._previous_backoff
 
 
+class ExponentialWithJitterBackoff(AbstractBackoff):
+    """Exponential backoff upon failure, with jitter"""
+
+    def __init__(self, cap: float = DEFAULT_CAP, base: float = DEFAULT_BASE) -> None:
+        """
+        `cap`: maximum backoff time in seconds
+        `base`: base backoff time in seconds
+        """
+        self._cap = cap
+        self._base = base
+
+    def compute(self, failures: int) -> float:
+        return min(self._cap, random.random() * self._base * 2**failures)
+
+
 def default_backoff():
     return EqualJitterBackoff()


Test patch:
diff --git a/tests/test_backoff.py b/tests/test_backoff.py
new file mode 100644
index 00000000..0a491276
--- /dev/null
+++ b/tests/test_backoff.py
@@ -0,0 +1,18 @@
+from unittest.mock import Mock
+
+import pytest
+
+from redis.backoff import ExponentialWithJitterBackoff
+
+
+def test_exponential_with_jitter_backoff(monkeypatch: pytest.MonkeyPatch) -> None:
+    mock_random = Mock(side_effect=[0.25, 0.5, 0.75, 1.0, 0.9])
+    monkeypatch.setattr("random.random", mock_random)
+
+    bo = ExponentialWithJitterBackoff(cap=5, base=1)
+
+    assert bo.compute(0) == 0.25  # min(5, 0.25*2^0)
+    assert bo.compute(1) == 1.0  # min(5, 0.5*2^1)
+    assert bo.compute(2) == 3.0  # min(5, 0.75*2^2)
+    assert bo.compute(3) == 5.0  # min(5, 1*2^3)
+    assert bo.compute(4) == 5.0  # min(5, 0.9*2^4)
Repository: pgmpy/pgmpy
Pull request #801 (2016-12-23 19:01:37)

Returned independencies object in NaiveBayesian local_Independecy #722
In reference to #722


Patch:
diff --git a/pgmpy/models/NaiveBayes.py b/pgmpy/models/NaiveBayes.py
index bcc67e18..83ed9904 100644
--- a/pgmpy/models/NaiveBayes.py
+++ b/pgmpy/models/NaiveBayes.py
@@ -160,13 +160,10 @@ class NaiveBayes(BayesianModel):
         >>> ind
         [(b _|_ d, c | a)]
         """
-        independencies = []
+        independencies = Independencies()
         for variable in [variables] if isinstance(variables, str) else variables:
             if variable != self.parent_node:
-                independencies.append(Independencies(
-                    [variable, list(set(self.children_nodes) - set(variable)), self.parent_node]))
-            else:
-                independencies.append(None)
+                independencies.add_assertions([variable, list(set(self.children_nodes) - set(variable)), self.parent_node])
         return independencies
 
     def fit(self, data, parent_node=None, estimator_type=None):


Test patch:
diff --git a/pgmpy/tests/test_models/test_NaiveBayes.py b/pgmpy/tests/test_models/test_NaiveBayes.py
index 3f1b064c..22aec89b 100644
--- a/pgmpy/tests/test_models/test_NaiveBayes.py
+++ b/pgmpy/tests/test_models/test_NaiveBayes.py
@@ -129,13 +129,10 @@ class TestNaiveBayesMethods(unittest.TestCase):
                               ('d', 's')])
 
     def test_local_independencies(self):
-        self.assertListEqual(self.G1.local_independencies('a'), [None])
-        self.assertListEqual(self.G1.local_independencies('b'),
-                             [Independencies(['b', ['e', 'c', 'd'], 'a'])])
-        self.assertListEqual(self.G1.local_independencies('c'),
-                             [Independencies(['c', ['e', 'b', 'd'], 'a'])])
-        self.assertListEqual(self.G1.local_independencies('d'),
-                             [Independencies(['d', ['b', 'c', 'e'], 'a'])])
+        self.assertEqual(self.G1.local_independencies('a'), Independencies())
+        self.assertEqual(self.G1.local_independencies('b'), Independencies(['b', ['e', 'c', 'd'], 'a']))
+        self.assertEqual(self.G1.local_independencies('c'), Independencies(['c', ['e', 'b', 'd'], 'a']))
+        self.assertEqual(self.G1.local_independencies('d'), Independencies(['d', ['b', 'c', 'e'], 'a']))
 
     def test_active_trail_nodes(self):
         self.assertListEqual(sorted(self.G2.active_trail_nodes('d')), ['d', 'g', 'l', 's'])
Repository: bitcoin-core/secp256k1
Pull request #1012 (2021-11-13 00:13:38)

Fix typos


Patch:
diff --git a/configure.ac b/configure.ac
index 906f63c..48705c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ AC_PATH_TOOL(STRIP, strip)
 
 # Save definition of AC_PROG_CC because AM_PROG_CC_C_O in automake<=1.13 will
 # redefine AC_PROG_CC to exit with an error, which avoids the user calling it
-# accidently and screwing up the effect of AM_PROG_CC_C_O. However, we'll need
+# accidentally and screwing up the effect of AM_PROG_CC_C_O. However, we'll need
 # AC_PROG_CC later on in AX_PROG_CC_FOR_BUILD, where its usage is fine, and
 # we'll carefully make sure not to call AC_PROG_CC anywhere else.
 m4_copy([AC_PROG_CC], [saved_AC_PROG_CC])
diff --git a/src/ecmult_impl.h b/src/ecmult_impl.h
index 87ccc73..5d94091 100644
--- a/src/ecmult_impl.h
+++ b/src/ecmult_impl.h
@@ -220,7 +220,7 @@ struct secp256k1_strauss_state {
 static void secp256k1_ecmult_strauss_wnaf(const struct secp256k1_strauss_state *state, secp256k1_gej *r, size_t num, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
     secp256k1_ge tmpa;
     secp256k1_fe Z;
-    /* Splitted G factors. */
+    /* Split G factors. */
     secp256k1_scalar ng_1, ng_128;
     int wnaf_ng_1[129];
     int bits_ng_1 = 0;
diff --git a/src/scalar_impl.h b/src/scalar_impl.h
index e124474..1b690e3 100644
--- a/src/scalar_impl.h
+++ b/src/scalar_impl.h
@@ -74,7 +74,7 @@ static void secp256k1_scalar_split_lambda_verify(const secp256k1_scalar *r1, con
  * Both lambda and beta are primitive cube roots of unity.  That is lamba^3 == 1 mod n and
  * beta^3 == 1 mod p, where n is the curve order and p is the field order.
  *
- * Futhermore, because (X^3 - 1) = (X - 1)(X^2 + X + 1), the primitive cube roots of unity are
+ * Furthermore, because (X^3 - 1) = (X - 1)(X^2 + X + 1), the primitive cube roots of unity are
  * roots of X^2 + X + 1.  Therefore lambda^2 + lamba == -1 mod n and beta^2 + beta == -1 mod p.
  * (The other primitive cube roots of unity are lambda^2 and beta^2 respectively.)
  *


Test patch:
diff --git a/src/tests.c b/src/tests.c
index ebeef51..6027ebc 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -3225,7 +3225,7 @@ void test_intialized_inf(void) {
     secp256k1_gej pj, npj, infj1, infj2, infj3;
     secp256k1_fe zinv;
 
-    /* Test that adding P+(-P) results in a fully initalized infinity*/
+    /* Test that adding P+(-P) results in a fully initialized infinity*/
     random_group_element_test(&p);
     secp256k1_gej_set_ge(&pj, &p);
     secp256k1_gej_neg(&npj, &pj);