prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Change path of storage of Evaluation Scripts
  ## Current behaviour
  
  Currently, the evaluation scripts are stored in the `submission_files` directory which should not happen ideally.
  
  ## Solution
  Modify the `RandomFile()` method such that the evaluation scripts should be uploaded in the `evaluation_scripts` directory instead of the `submission_files` directory. 
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `apps/base/utils.py`
  Content:
  ```
  1 import os
  2 import uuid
  3 
  4 from django.conf import settings
  5 from django.utils.deconstruct import deconstructible
  6 
  7 from rest_framework.exceptions import NotFound
  8 from rest_framework.pagination import PageNumberPagination
  9 
  10 
  11 class StandardResultSetPagination(PageNumberPagination):
  12     page_size = 100
  13     page_size_query_param = 'page_size'
  14     max_page_size = 1000
  15 
  16 
  17 def paginated_queryset(queryset, request, pagination_class=PageNumberPagination()):
  18     '''
  19         Return a paginated result for a queryset
  20     '''
  21     paginator = pagination_class
  22     paginator.page_size = settings.REST_FRAMEWORK['PAGE_SIZE']
  23     result_page = paginator.paginate_queryset(queryset, request)
  24     return (paginator, result_page)
  25 
  26 
  27 @deconstructible
  28 class RandomFileName(object):
  29     def __init__(self, path):
  30         self.path = path
  31 
  32     def __call__(self, instance, filename):
  33         extension = os.path.splitext(filename)[1]
  34         if 'id' in self.path and instance.pk:
  35             self.path = self.path.format(id=instance.pk)
  36         elif 'id' not in self.path and instance.pk:
  37             path = "submission_files/submission_{id}"
  38             self.path = path.format(id=instance.pk)
  39         filename = '{}{}'.format(uuid.uuid4(), extension)
  40         filename = os.path.join(self.path, filename)
  41         return filename
  42 
  43 
  44 def get_model_object(model_name):
  45     def get_model_by_pk(pk):
  46         try:
  47             model_object = model_name.objects.get(pk=pk)
  48             return model_object
  49         except model_name.DoesNotExist:
  50             raise NotFound('{} {} does not exist'.format(model_name.__name__, pk))
  51     get_model_by_pk.__name__ = 'get_{}_object'.format(model_name.__name__.lower())
  52     return get_model_by_pk
  53
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/apps/base/utils.py b/apps/base/utils.py
  --- a/apps/base/utils.py
  +++ b/apps/base/utils.py
  @@ -2,7 +2,6 @@
   import uuid
   
   from django.conf import settings
  -from django.utils.deconstruct import deconstructible
   
   from rest_framework.exceptions import NotFound
   from rest_framework.pagination import PageNumberPagination
  @@ -24,20 +23,17 @@
       return (paginator, result_page)
   
   
  -@deconstructible
   class RandomFileName(object):
       def __init__(self, path):
           self.path = path
   
       def __call__(self, instance, filename):
           extension = os.path.splitext(filename)[1]
  +        path = self.path
           if 'id' in self.path and instance.pk:
  -            self.path = self.path.format(id=instance.pk)
  -        elif 'id' not in self.path and instance.pk:
  -            path = "submission_files/submission_{id}"
  -            self.path = path.format(id=instance.pk)
  +            path = self.path.format(id=instance.pk)
           filename = '{}{}'.format(uuid.uuid4(), extension)
  -        filename = os.path.join(self.path, filename)
  +        filename = os.path.join(path, filename)
           return filename
  
verification_info: {"golden_diff": "diff --git a/apps/base/utils.py b/apps/base/utils.py\n--- a/apps/base/utils.py\n+++ b/apps/base/utils.py\n@@ -2,7 +2,6 @@\n import uuid\n \n from django.conf import settings\n-from django.utils.deconstruct import deconstructible\n \n from rest_framework.exceptions import NotFound\n from rest_framework.pagination import PageNumberPagination\n@@ -24,20 +23,17 @@\n     return (paginator, result_page)\n \n \n-@deconstructible\n class RandomFileName(object):\n     def __init__(self, path):\n         self.path = path\n \n     def __call__(self, instance, filename):\n         extension = os.path.splitext(filename)[1]\n+        path = self.path\n         if 'id' in self.path and instance.pk:\n-            self.path = self.path.format(id=instance.pk)\n-        elif 'id' not in self.path and instance.pk:\n-            path = \"submission_files/submission_{id}\"\n-            self.path = path.format(id=instance.pk)\n+            path = self.path.format(id=instance.pk)\n         filename = '{}{}'.format(uuid.uuid4(), extension)\n-        filename = os.path.join(self.path, filename)\n+        filename = os.path.join(path, filename)\n         return filename\n", "issue": "Change path of storage of Evaluation Scripts\n## Current behaviour\r\n\r\nCurrently, the evaluation scripts are stored in the `submission_files` directory which should not happen ideally.\r\n\r\n## Solution\r\nModify the `RandomFile()` method such that the evaluation scripts should be uploaded in the `evaluation_scripts` directory instead of the `submission_files` directory. \r\n\n", "before_files": [{"content": "import os\nimport uuid\n\nfrom django.conf import settings\nfrom django.utils.deconstruct import deconstructible\n\nfrom rest_framework.exceptions import NotFound\nfrom rest_framework.pagination import PageNumberPagination\n\n\nclass StandardResultSetPagination(PageNumberPagination):\n    page_size = 100\n    page_size_query_param = 'page_size'\n    max_page_size = 1000\n\n\ndef paginated_queryset(queryset, request, pagination_class=PageNumberPagination()):\n    '''\n        Return a paginated result for a queryset\n    '''\n    paginator = pagination_class\n    paginator.page_size = settings.REST_FRAMEWORK['PAGE_SIZE']\n    result_page = paginator.paginate_queryset(queryset, request)\n    return (paginator, result_page)\n\n\n@deconstructible\nclass RandomFileName(object):\n    def __init__(self, path):\n        self.path = path\n\n    def __call__(self, instance, filename):\n        extension = os.path.splitext(filename)[1]\n        if 'id' in self.path and instance.pk:\n            self.path = self.path.format(id=instance.pk)\n        elif 'id' not in self.path and instance.pk:\n            path = \"submission_files/submission_{id}\"\n            self.path = path.format(id=instance.pk)\n        filename = '{}{}'.format(uuid.uuid4(), extension)\n        filename = os.path.join(self.path, filename)\n        return filename\n\n\ndef get_model_object(model_name):\n    def get_model_by_pk(pk):\n        try:\n            model_object = model_name.objects.get(pk=pk)\n            return model_object\n        except model_name.DoesNotExist:\n            raise NotFound('{} {} does not exist'.format(model_name.__name__, pk))\n    get_model_by_pk.__name__ = 'get_{}_object'.format(model_name.__name__.lower())\n    return get_model_by_pk\n", "path": "apps/base/utils.py"}], "after_files": [{"content": "import os\nimport uuid\n\nfrom django.conf import settings\n\nfrom rest_framework.exceptions import NotFound\nfrom rest_framework.pagination import PageNumberPagination\n\n\nclass StandardResultSetPagination(PageNumberPagination):\n    page_size = 100\n    page_size_query_param = 'page_size'\n    max_page_size = 1000\n\n\ndef paginated_queryset(queryset, request, pagination_class=PageNumberPagination()):\n    '''\n        Return a paginated result for a queryset\n    '''\n    paginator = pagination_class\n    paginator.page_size = settings.REST_FRAMEWORK['PAGE_SIZE']\n    result_page = paginator.paginate_queryset(queryset, request)\n    return (paginator, result_page)\n\n\nclass RandomFileName(object):\n    def __init__(self, path):\n        self.path = path\n\n    def __call__(self, instance, filename):\n        extension = os.path.splitext(filename)[1]\n        path = self.path\n        if 'id' in self.path and instance.pk:\n            path = self.path.format(id=instance.pk)\n        filename = '{}{}'.format(uuid.uuid4(), extension)\n        filename = os.path.join(path, filename)\n        return filename\n\n\ndef get_model_object(model_name):\n    def get_model_by_pk(pk):\n        try:\n            model_object = model_name.objects.get(pk=pk)\n            return model_object\n        except model_name.DoesNotExist:\n            raise NotFound('{} {} does not exist'.format(model_name.__name__, pk))\n    get_model_by_pk.__name__ = 'get_{}_object'.format(model_name.__name__.lower())\n    return get_model_by_pk\n", "path": "apps/base/utils.py"}]}