{"instance_id": "django__django-15569", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py\nindex 0caa165e15..6917820604 100644\n--- a/django/db/models/query_utils.py\n+++ b/django/db/models/query_utils.py\n@@ -217,6 +217,7 @@ class RegisterLookupMixin:\n         if lookup_name is None:\n             lookup_name = lookup.lookup_name\n         del cls.class_lookups[lookup_name]\n+        cls._clear_cached_lookups()\n \n \n def select_related_descend(field, restricted, requested, load_fields, reverse=False):\n", "model": "claude-sonnet-5-5", "steps": 4, "finished": true, "patch_lines": 12, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 12, "steps": 4}], "ms": 7123}
{"instance_id": "psf__requests-5414", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/requests/models.py b/requests/models.py\nindex e7d292d5..d8638818 100644\n--- a/requests/models.py\n+++ b/requests/models.py\n@@ -403,7 +403,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):\n                 host = self._get_idna_encoded_host(host)\n             except UnicodeError:\n                 raise InvalidURL('URL has an invalid label.')\n-        elif host.startswith(u'*'):\n+        elif host.startswith((u'*', u'.')):\n             raise InvalidURL('URL has an invalid label.')\n \n         # Carefully reconstruct the network location\n", "model": "claude-sonnet-5-5", "steps": 6, "finished": true, "patch_lines": 13, "candidates": [{"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 13, "steps": 6}], "ms": 11191}
{"instance_id": "astropy__astropy-13579", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/astropy/wcs/wcsapi/wrappers/sliced_wcs.py b/astropy/wcs/wcsapi/wrappers/sliced_wcs.py\nindex d7605b078c..349422d9eb 100644\n--- a/astropy/wcs/wcsapi/wrappers/sliced_wcs.py\n+++ b/astropy/wcs/wcsapi/wrappers/sliced_wcs.py\n@@ -244,6 +244,8 @@ class SlicedLowLevelWCS(BaseWCSWrapper):\n \n     def world_to_pixel_values(self, *world_arrays):\n         world_arrays = tuple(map(np.asanyarray, world_arrays))\n+        sliced_out_world_coords = self._pixel_to_world_values_all(*[0]*len(self._pixel_keep))\n+\n         world_arrays_new = []\n         iworld_curr = -1\n         for iworld in range(self._wcs.world_n_dim):\n@@ -251,7 +253,7 @@ class SlicedLowLevelWCS(BaseWCSWrapper):\n                 iworld_curr += 1\n                 world_arrays_new.append(world_arrays[iworld_curr])\n             else:\n-                world_arrays_new.append(1.)\n+                world_arrays_new.append(sliced_out_world_coords[iworld])\n \n         world_arrays_new = np.broadcast_arrays(*world_arrays_new)\n         pixel_arrays = list(self._wcs.world_to_pixel_values(*world_arrays_new))\n", "model": "claude-sonnet-5-5", "steps": 5, "finished": true, "patch_lines": 22, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 22, "steps": 5}], "ms": 16518}
{"instance_id": "django__django-13195", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/django/contrib/messages/storage/cookie.py b/django/contrib/messages/storage/cookie.py\nindex 78256ca3b2..b51e292aa0 100644\n--- a/django/contrib/messages/storage/cookie.py\n+++ b/django/contrib/messages/storage/cookie.py\n@@ -92,7 +92,11 @@ class CookieStorage(BaseStorage):\n                 samesite=settings.SESSION_COOKIE_SAMESITE,\n             )\n         else:\n-            response.delete_cookie(self.cookie_name, domain=settings.SESSION_COOKIE_DOMAIN)\n+            response.delete_cookie(\n+                self.cookie_name,\n+                domain=settings.SESSION_COOKIE_DOMAIN,\n+                samesite=settings.SESSION_COOKIE_SAMESITE,\n+            )\n \n     def _store(self, messages, response, remove_oldest=True, *args, **kwargs):\n         \"\"\"\ndiff --git a/django/contrib/sessions/middleware.py b/django/contrib/sessions/middleware.py\nindex 63013eef7a..95ad30ce7f 100644\n--- a/django/contrib/sessions/middleware.py\n+++ b/django/contrib/sessions/middleware.py\n@@ -42,6 +42,7 @@ class SessionMiddleware(MiddlewareMixin):\n                 settings.SESSION_COOKIE_NAME,\n                 path=settings.SESSION_COOKIE_PATH,\n                 domain=settings.SESSION_COOKIE_DOMAIN,\n+                samesite=settings.SESSION_COOKIE_SAMESITE,\n             )\n             patch_vary_headers(response, ('Cookie',))\n         else:\ndiff --git a/django/http/response.py b/django/http/response.py\nindex e00bcacefb..cca175f8eb 100644\n--- a/django/http/response.py\n+++ b/django/http/response.py\n@@ -210,13 +210,16 @@ class HttpResponseBase:\n         value = signing.get_cookie_signer(salt=key + salt).sign(value)\n         return self.set_cookie(key, value, **kwargs)\n \n-    def delete_cookie(self, key, path='/', domain=None):\n+    def delete_cookie(self, key, path='/', domain=None, samesite=None):\n         # Most browsers ignore the Set-Cookie header if the cookie name starts\n         # with __Host- or __Secure- and the cookie doesn't use the secure flag.\n-        secure = key.startswith(('__Secure-', '__Host-'))\n+        secure = (\n+            key.startswith(('__Secure-', '__Host-')) or\n+            (samesite and samesite.lower() == 'none')\n+        )\n         self.set_cookie(\n             key, max_age=0, path=path, domain=domain, secure=secure,\n-            expires='Thu, 01 Jan 1970 00:00:00 GMT',\n+            expires='Thu, 01 Jan 1970 00:00:00 GMT', samesite=samesite,\n         )\n \n     # Common methods used by subclasses\n", "model": "claude-sonnet-5-5", "steps": 7, "finished": true, "patch_lines": 53, "candidates": [{"compile_ok": 0, "loc_hits": 1, "files": 3, "diff_lines": 53, "steps": 7}], "ms": 21533}
{"instance_id": "sympy__sympy-23413", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sympy/polys/matrices/normalforms.py b/sympy/polys/matrices/normalforms.py\nindex 30f5534b08..286b411726 100644\n--- a/sympy/polys/matrices/normalforms.py\n+++ b/sympy/polys/matrices/normalforms.py\n@@ -205,16 +205,17 @@ def _hermite_normal_form(A):\n     if not A.domain.is_ZZ:\n         raise DMDomainError('Matrix must be over domain ZZ.')\n     # We work one row at a time, starting from the bottom row, and working our\n-    # way up. The total number of rows we will consider is min(m, n), where\n-    # A is an m x n matrix.\n+    # way up. We stop once every column has a pivot, but zero rows do not use\n+    # up a pivot column, so we may need to look at more than min(m, n) rows.\n     m, n = A.shape\n-    rows = min(m, n)\n     A = A.to_dense().rep.copy()\n     # Our goal is to put pivot entries in the rightmost columns.\n     # Invariant: Before processing each row, k should be the index of the\n     # leftmost column in which we have so far put a pivot.\n     k = n\n-    for i in range(m - 1, m - 1 - rows, -1):\n+    for i in range(m - 1, -1, -1):\n+        if k == 0:\n+            break\n         k -= 1\n         # k now points to the column in which we want to put a pivot.\n         # We want zeros in all entries to the left of the pivot column.\n", "model": "claude-sonnet-5-5", "steps": 9, "finished": true, "patch_lines": 26, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 26, "steps": 9}], "ms": 19045}
