prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Move plugin focused functions to the plugins folder
  `override_template`
  `register_plugin_script`
  `register_plugin_stylesheet`
  
  These should move to the plugins directory.
  
  </issue>
  <code>
  [start of CTFd/plugins/__init__.py]
  1 import glob
  2 import importlib
  3 import os
  4 
  5 from flask.helpers import safe_join
  6 from flask import send_file, send_from_directory, abort
  7 from CTFd.utils import admins_only as admins_only_wrapper
  8 
  9 
  10 def register_plugin_assets_directory(app, base_path, admins_only=False):
  11     """
  12     Registers a directory to serve assets
  13 
  14     :param app: A CTFd application
  15     :param string base_path: The path to the directory
  16     :param boolean admins_only: Whether or not the assets served out of the directory should be accessible to the public
  17     :return:
  18     """
  19     base_path = base_path.strip('/')
  20 
  21     def assets_handler(path):
  22         return send_from_directory(base_path, path)
  23 
  24     if admins_only:
  25         asset_handler = admins_only_wrapper(assets_handler)
  26 
  27     rule = '/' + base_path + '/<path:path>'
  28     app.add_url_rule(rule=rule, endpoint=base_path, view_func=assets_handler)
  29 
  30 
  31 def register_plugin_asset(app, asset_path, admins_only=False):
  32     """
  33     Registers an file path to be served by CTFd
  34 
  35     :param app: A CTFd application
  36     :param string asset_path: The path to the asset file
  37     :param boolean admins_only: Whether or not this file should be accessible to the public
  38     :return:
  39     """
  40     asset_path = asset_path.strip('/')
  41 
  42     def asset_handler():
  43         return send_file(asset_path)
  44 
  45     if admins_only:
  46         asset_handler = admins_only_wrapper(asset_handler)
  47     rule = '/' + asset_path
  48     app.add_url_rule(rule=rule, endpoint=asset_path, view_func=asset_handler)
  49 
  50 
  51 def init_plugins(app):
  52     """
  53     Searches for the load function in modules in the CTFd/plugins folder. This function is called with the current CTFd
  54     app as a parameter. This allows CTFd plugins to modify CTFd's behavior.
  55 
  56     :param app: A CTFd application
  57     :return:
  58     """
  59     modules = glob.glob(os.path.dirname(__file__) + "/*")
  60     blacklist = {'__pycache__'}
  61     for module in modules:
  62         module_name = os.path.basename(module)
  63         if os.path.isdir(module) and module_name not in blacklist:
  64             module = '.' + module_name
  65             module = importlib.import_module(module, package='CTFd.plugins')
  66             module.load(app)
  67             print(" * Loaded module, %s" % module)
  68
  [end of CTFd/plugins/__init__.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/CTFd/plugins/__init__.py b/CTFd/plugins/__init__.py
  --- a/CTFd/plugins/__init__.py
  +++ b/CTFd/plugins/__init__.py
  @@ -3,8 +3,13 @@
   import os
   
   from flask.helpers import safe_join
  -from flask import send_file, send_from_directory, abort
  -from CTFd.utils import admins_only as admins_only_wrapper
  +from flask import current_app as app, send_file, send_from_directory, abort
  +from CTFd.utils import (
  +    admins_only as admins_only_wrapper,
  +    override_template as utils_override_template,
  +    register_plugin_script as utils_register_plugin_script,
  +    register_plugin_stylesheet as utils_register_plugin_stylesheet
  +)
   
   
   def register_plugin_assets_directory(app, base_path, admins_only=False):
  @@ -48,6 +53,29 @@
       app.add_url_rule(rule=rule, endpoint=asset_path, view_func=asset_handler)
   
   
  +def override_template(*args, **kwargs):
  +    """
  +    Overrides a template with the provided html content.
  +
  +    e.g. override_template('scoreboard.html', '<h1>scores</h1>')
  +    """
  +    utils_override_template(*args, **kwargs)
  +
  +
  +def register_plugin_script(*args, **kwargs):
  +    """
  +    Adds a given script to the base.html template which all pages inherit from
  +    """
  +    utils_register_plugin_script(*args, **kwargs)
  +
  +
  +def register_plugin_stylesheet(*args, **kwargs):
  +    """
  +    Adds a given stylesheet to the base.html template which all pages inherit from.
  +    """
  +    utils_register_plugin_stylesheet(*args, **kwargs)
  +
  +
   def init_plugins(app):
       """
       Searches for the load function in modules in the CTFd/plugins folder. This function is called with the current CTFd
  
verification_info: {"golden_diff": "diff --git a/CTFd/plugins/__init__.py b/CTFd/plugins/__init__.py\n--- a/CTFd/plugins/__init__.py\n+++ b/CTFd/plugins/__init__.py\n@@ -3,8 +3,13 @@\n import os\n \n from flask.helpers import safe_join\n-from flask import send_file, send_from_directory, abort\n-from CTFd.utils import admins_only as admins_only_wrapper\n+from flask import current_app as app, send_file, send_from_directory, abort\n+from CTFd.utils import (\n+    admins_only as admins_only_wrapper,\n+    override_template as utils_override_template,\n+    register_plugin_script as utils_register_plugin_script,\n+    register_plugin_stylesheet as utils_register_plugin_stylesheet\n+)\n \n \n def register_plugin_assets_directory(app, base_path, admins_only=False):\n@@ -48,6 +53,29 @@\n     app.add_url_rule(rule=rule, endpoint=asset_path, view_func=asset_handler)\n \n \n+def override_template(*args, **kwargs):\n+    \"\"\"\n+    Overrides a template with the provided html content.\n+\n+    e.g. override_template('scoreboard.html', '<h1>scores</h1>')\n+    \"\"\"\n+    utils_override_template(*args, **kwargs)\n+\n+\n+def register_plugin_script(*args, **kwargs):\n+    \"\"\"\n+    Adds a given script to the base.html template which all pages inherit from\n+    \"\"\"\n+    utils_register_plugin_script(*args, **kwargs)\n+\n+\n+def register_plugin_stylesheet(*args, **kwargs):\n+    \"\"\"\n+    Adds a given stylesheet to the base.html template which all pages inherit from.\n+    \"\"\"\n+    utils_register_plugin_stylesheet(*args, **kwargs)\n+\n+\n def init_plugins(app):\n     \"\"\"\n     Searches for the load function in modules in the CTFd/plugins folder. This function is called with the current CTFd\n", "issue": "Move plugin focused functions to the plugins folder\n`override_template`\r\n`register_plugin_script`\r\n`register_plugin_stylesheet`\r\n\r\nThese should move to the plugins directory.\n", "before_files": [{"content": "import glob\nimport importlib\nimport os\n\nfrom flask.helpers import safe_join\nfrom flask import send_file, send_from_directory, abort\nfrom CTFd.utils import admins_only as admins_only_wrapper\n\n\ndef register_plugin_assets_directory(app, base_path, admins_only=False):\n    \"\"\"\n    Registers a directory to serve assets\n\n    :param app: A CTFd application\n    :param string base_path: The path to the directory\n    :param boolean admins_only: Whether or not the assets served out of the directory should be accessible to the public\n    :return:\n    \"\"\"\n    base_path = base_path.strip('/')\n\n    def assets_handler(path):\n        return send_from_directory(base_path, path)\n\n    if admins_only:\n        asset_handler = admins_only_wrapper(assets_handler)\n\n    rule = '/' + base_path + '/<path:path>'\n    app.add_url_rule(rule=rule, endpoint=base_path, view_func=assets_handler)\n\n\ndef register_plugin_asset(app, asset_path, admins_only=False):\n    \"\"\"\n    Registers an file path to be served by CTFd\n\n    :param app: A CTFd application\n    :param string asset_path: The path to the asset file\n    :param boolean admins_only: Whether or not this file should be accessible to the public\n    :return:\n    \"\"\"\n    asset_path = asset_path.strip('/')\n\n    def asset_handler():\n        return send_file(asset_path)\n\n    if admins_only:\n        asset_handler = admins_only_wrapper(asset_handler)\n    rule = '/' + asset_path\n    app.add_url_rule(rule=rule, endpoint=asset_path, view_func=asset_handler)\n\n\ndef init_plugins(app):\n    \"\"\"\n    Searches for the load function in modules in the CTFd/plugins folder. This function is called with the current CTFd\n    app as a parameter. This allows CTFd plugins to modify CTFd's behavior.\n\n    :param app: A CTFd application\n    :return:\n    \"\"\"\n    modules = glob.glob(os.path.dirname(__file__) + \"/*\")\n    blacklist = {'__pycache__'}\n    for module in modules:\n        module_name = os.path.basename(module)\n        if os.path.isdir(module) and module_name not in blacklist:\n            module = '.' + module_name\n            module = importlib.import_module(module, package='CTFd.plugins')\n            module.load(app)\n            print(\" * Loaded module, %s\" % module)\n", "path": "CTFd/plugins/__init__.py"}]}