prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add pagination to the `chains/` endpoint
  Add pagination support to `api/v1/chains`
  
  </issue>
  <code>
  [start of src/chains/views.py]
  1 from drf_yasg.utils import swagger_auto_schema
  2 from rest_framework.generics import ListAPIView
  3 
  4 from .models import Chain
  5 from .serializers import ChainSerializer
  6 
  7 
  8 class ChainsListView(ListAPIView):
  9     serializer_class = ChainSerializer
  10 
  11     @swagger_auto_schema()
  12     def get(self, request, *args, **kwargs):
  13         return super().get(self, request, *args, **kwargs)
  14 
  15     def get_queryset(self):
  16         return Chain.objects.all()
  17
  [end of src/chains/views.py]
  [start of src/safe_apps/views.py]
  1 from django.utils.decorators import method_decorator
  2 from django.views.decorators.cache import cache_page
  3 from drf_yasg import openapi
  4 from drf_yasg.utils import swagger_auto_schema
  5 from rest_framework.generics import ListAPIView
  6 
  7 from .models import SafeApp
  8 from .serializers import SafeAppsResponseSerializer
  9 
  10 
  11 class SafeAppsListView(ListAPIView):
  12     serializer_class = SafeAppsResponseSerializer
  13 
  14     _swagger_network_id_param = openapi.Parameter(
  15         "chainId",
  16         openapi.IN_QUERY,
  17         description="Used to filter Safe Apps that are available on `chainId`",
  18         type=openapi.TYPE_INTEGER,
  19     )
  20 
  21     @method_decorator(cache_page(60 * 10, cache="safe-apps"))  # Cache 10 minutes
  22     @swagger_auto_schema(manual_parameters=[_swagger_network_id_param])
  23     def get(self, request, *args, **kwargs):
  24         """
  25         Returns a collection of Safe Apps (across different chains).
  26         Each Safe App can optionally include the information about the `Provider`
  27         """
  28         return super().get(self, request, *args, **kwargs)
  29 
  30     def get_queryset(self):
  31         queryset = SafeApp.objects.all()
  32 
  33         network_id = self.request.query_params.get("chainId")
  34         if network_id is not None and network_id.isdigit():
  35             queryset = queryset.filter(chain_ids__contains=[network_id])
  36 
  37         return queryset
  38
  [end of src/safe_apps/views.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/chains/views.py b/src/chains/views.py
  --- a/src/chains/views.py
  +++ b/src/chains/views.py
  @@ -1,5 +1,6 @@
   from drf_yasg.utils import swagger_auto_schema
   from rest_framework.generics import ListAPIView
  +from rest_framework.pagination import LimitOffsetPagination
   
   from .models import Chain
   from .serializers import ChainSerializer
  @@ -7,6 +8,9 @@
   
   class ChainsListView(ListAPIView):
       serializer_class = ChainSerializer
  +    pagination_class = LimitOffsetPagination
  +    pagination_class.max_limit = 10
  +    pagination_class.default_limit = 10
   
       @swagger_auto_schema()
       def get(self, request, *args, **kwargs):
  diff --git a/src/safe_apps/views.py b/src/safe_apps/views.py
  --- a/src/safe_apps/views.py
  +++ b/src/safe_apps/views.py
  @@ -10,6 +10,7 @@
   
   class SafeAppsListView(ListAPIView):
       serializer_class = SafeAppsResponseSerializer
  +    pagination_class = None
   
       _swagger_network_id_param = openapi.Parameter(
           "chainId",
  
verification_info: {"golden_diff": "diff --git a/src/chains/views.py b/src/chains/views.py\n--- a/src/chains/views.py\n+++ b/src/chains/views.py\n@@ -1,5 +1,6 @@\n from drf_yasg.utils import swagger_auto_schema\n from rest_framework.generics import ListAPIView\n+from rest_framework.pagination import LimitOffsetPagination\n \n from .models import Chain\n from .serializers import ChainSerializer\n@@ -7,6 +8,9 @@\n \n class ChainsListView(ListAPIView):\n     serializer_class = ChainSerializer\n+    pagination_class = LimitOffsetPagination\n+    pagination_class.max_limit = 10\n+    pagination_class.default_limit = 10\n \n     @swagger_auto_schema()\n     def get(self, request, *args, **kwargs):\ndiff --git a/src/safe_apps/views.py b/src/safe_apps/views.py\n--- a/src/safe_apps/views.py\n+++ b/src/safe_apps/views.py\n@@ -10,6 +10,7 @@\n \n class SafeAppsListView(ListAPIView):\n     serializer_class = SafeAppsResponseSerializer\n+    pagination_class = None\n \n     _swagger_network_id_param = openapi.Parameter(\n         \"chainId\",\n", "issue": "Add pagination to the `chains/` endpoint\nAdd pagination support to `api/v1/chains`\n", "before_files": [{"content": "from drf_yasg.utils import swagger_auto_schema\nfrom rest_framework.generics import ListAPIView\n\nfrom .models import Chain\nfrom .serializers import ChainSerializer\n\n\nclass ChainsListView(ListAPIView):\n    serializer_class = ChainSerializer\n\n    @swagger_auto_schema()\n    def get(self, request, *args, **kwargs):\n        return super().get(self, request, *args, **kwargs)\n\n    def get_queryset(self):\n        return Chain.objects.all()\n", "path": "src/chains/views.py"}, {"content": "from django.utils.decorators import method_decorator\nfrom django.views.decorators.cache import cache_page\nfrom drf_yasg import openapi\nfrom drf_yasg.utils import swagger_auto_schema\nfrom rest_framework.generics import ListAPIView\n\nfrom .models import SafeApp\nfrom .serializers import SafeAppsResponseSerializer\n\n\nclass SafeAppsListView(ListAPIView):\n    serializer_class = SafeAppsResponseSerializer\n\n    _swagger_network_id_param = openapi.Parameter(\n        \"chainId\",\n        openapi.IN_QUERY,\n        description=\"Used to filter Safe Apps that are available on `chainId`\",\n        type=openapi.TYPE_INTEGER,\n    )\n\n    @method_decorator(cache_page(60 * 10, cache=\"safe-apps\"))  # Cache 10 minutes\n    @swagger_auto_schema(manual_parameters=[_swagger_network_id_param])\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Returns a collection of Safe Apps (across different chains).\n        Each Safe App can optionally include the information about the `Provider`\n        \"\"\"\n        return super().get(self, request, *args, **kwargs)\n\n    def get_queryset(self):\n        queryset = SafeApp.objects.all()\n\n        network_id = self.request.query_params.get(\"chainId\")\n        if network_id is not None and network_id.isdigit():\n            queryset = queryset.filter(chain_ids__contains=[network_id])\n\n        return queryset\n", "path": "src/safe_apps/views.py"}]}