nebius/SWE-bench-extra huggingface dataset:
Repository: genericclient/genericclient-requests

Issue:
Does not handle response status code 401
When a user sends a GET request to a DRF server using invalid base authentication email/password values, a response status code of 401 is returned. The client does not raise an exception when this happens, which results in a None resource being returned. The client should raise NotAuthenticatedError for both 401 and 403 status codes. See https://www.django-rest-framework.org/api-guide/authentication/

Comments:

Patch:
diff --git a/genericclient/__init__.py b/genericclient/__init__.py
index fc0d66a..89af323 100644
--- a/genericclient/__init__.py
+++ b/genericclient/__init__.py
@@ -24,7 +24,7 @@ class Endpoint(BaseEndpoint):
             data=self.api.hydrate_data(resp),
         )
 
-        if response.status_code == 403:
+        if response.status_code in (401, 403):
             if self.api.session.auth:
                 msg = "Failed request to `{}`. Cannot authenticate user `{}` on the API.".format(
                     url, self.api.session.auth[0],


Test patch:
diff --git a/tests/test_auth.py b/tests/test_auth.py
index c7a99cb..79c4ce9 100644
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -8,6 +8,15 @@ MOCK_API_URL = 'http://dummy.org'
 
 
 class AuthClientTestCase(TestCase):
+    def test_401(self):
+        generic_client = GenericClient(
+            url=MOCK_API_URL,
+        )
+        with responses.RequestsMock() as rsps:
+            rsps.add(responses.GET, MOCK_API_URL + '/users', status=401)
+            with self.assertRaises(generic_client.NotAuthenticatedError):
+                generic_client.users.all()
+
     def test_403(self):
         generic_client = GenericClient(
             url=MOCK_API_URL,
@@ -17,7 +26,6 @@ class AuthClientTestCase(TestCase):
             with self.assertRaises(generic_client.NotAuthenticatedError):
                 generic_client.users.all()
 
-
     def test_403_auth(self):
         generic_client = GenericClient(
             url=MOCK_API_URL,
diff --git a/tests/test_endpoint.py b/tests/test_endpoint.py
index 848e0b5..d035401 100644
--- a/tests/test_endpoint.py
+++ b/tests/test_endpoint.py
@@ -126,6 +126,12 @@ class EndpointTestCase(TestCase):
             self.assertRaises(generic_client.ResourceNotFound, generic_client.users.get, uuid=9999)
 
     def test_unauthenticated(self):
+        with responses.RequestsMock() as rsps:
+            rsps.add(responses.GET, MOCK_API_URL + '/users', status=401)
+
+            with self.assertRaises(generic_client.NotAuthenticatedError):
+                generic_client.users.all()
+
         with responses.RequestsMock() as rsps:
             rsps.add(responses.GET, MOCK_API_URL + '/users', status=403)
Repository: geomstats/geomstats

Issue:
SpecialEuclieanMatrixLieAlgebra randompoint has doesn't generate valid point
```
from geomstats.geometry.special_euclidean import SpecialEuclideanMatrixLieAlgebra 
algebra  = SpecialEuclideanMatrixLieAlgebra(2)
point = algebra.random_point(2) 
algebra.belongs(point)
```

Comments:

Patch:
diff --git a/geomstats/geometry/special_euclidean.py b/geomstats/geometry/special_euclidean.py
index 2090419f1..32a15efca 100644
--- a/geomstats/geometry/special_euclidean.py
+++ b/geomstats/geometry/special_euclidean.py
@@ -1307,9 +1307,10 @@ class SpecialEuclideanMatrixLieAlgebra(MatrixLieAlgebra):
 
     def __init__(self, n):
         dim = int(n * (n + 1) / 2)
-        super(SpecialEuclideanMatrixLieAlgebra, self).__init__(dim, n)
+        super(SpecialEuclideanMatrixLieAlgebra, self).__init__(dim, n + 1)
 
         self.skew = SkewSymmetricMatrices(n)
+        self.n = n
 
     def _create_basis(self):
         """Create the canonical basis."""
@@ -1356,6 +1357,28 @@ class SpecialEuclideanMatrixLieAlgebra(MatrixLieAlgebra):
         belongs = gs.logical_and(belongs, all_zeros)
         return belongs
 
+    def random_point(self, n_samples=1, bound=1.0):
+        """Sample in the lie algebra with a uniform distribution in a box.
+
+        Parameters
+        ----------
+        n_samples : int
+            Number of samples.
+            Optional, default: 1.
+        bound : float
+            Side of hypercube support of the uniform distribution.
+            Optional, default: 1.0
+
+        Returns
+        -------
+        point : array-like, shape=[..., n + 1, n + 1]
+           Sample.
+        """
+        point = super(SpecialEuclideanMatrixLieAlgebra, self).random_point(
+            n_samples, bound
+        )
+        return self.projection(point)
+
     def projection(self, mat):
         """Project a matrix to the Lie Algebra.
 


Test patch:
diff --git a/tests/tests_geomstats/test_special_euclidean.py b/tests/tests_geomstats/test_special_euclidean.py
index 6c56a44b7..7361f960b 100644
--- a/tests/tests_geomstats/test_special_euclidean.py
+++ b/tests/tests_geomstats/test_special_euclidean.py
@@ -205,6 +205,12 @@ class TestSpecialEuclidean(geomstats.tests.TestCase):
             algebra = SpecialEuclideanMatrixLieAlgebra(n)
             self.assertEqual(int(n * (n + 1) / 2), algebra.dim)
 
+    def test_random_and_belongs_lie_algerba(self):
+        algebra = self.group.lie_algebra
+        point = algebra.random_point(2)
+        results = algebra.belongs(point)
+        self.assertTrue(gs.all(results))
+
     def test_belongs_lie_algebra(self):
         theta = gs.pi / 3
         vec_1 = gs.array([[0.0, -theta, 2.0], [theta, 0.0, 3.0], [0.0, 0.0, 0.0]])