prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Allow exporter arguments in Jupyter ExecuteNotebook task
  ## Current behavior
  
  When running the `jupyter.jupyter.ExecuteNotebook` task with `output_format='html'` the default settings for the HTMLExporter are used. There is no way to pass arguments to this exporter.
  
  ## Proposed behavior
  
  Allow passing arguments to the HTMLExporter.
  
  ## Implementation suggestion
  
  Something like `html_exporter = nbconvert.HTMLExporter(**exporter_kwargs)` on the following line:
  https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/jupyter/jupyter.py#L65
  
  ## Example usecase
  
  This allows you to exclude code cells, only showing their output, in the exported html document by passing the `exclude_input=True` argument to the exporter.
  
  </issue>
  <code>
  [start of src/prefect/tasks/jupyter/jupyter.py]
  1 import nbconvert
  2 import nbformat
  3 import papermill as pm
  4 
  5 from prefect import Task
  6 from prefect.utilities.tasks import defaults_from_attrs
  7 
  8 
  9 class ExecuteNotebook(Task):
  10     """
  11     Task for running Jupyter Notebooks.
  12     In order to parametrize the notebook, you need to mark the parameters cell as described in
  13         the papermill documentation: https://papermill.readthedocs.io/en/latest/usage-parameterize.html
  14 
  15     Args:
  16         - path (string, optional): path to fetch the notebook from.
  17             Can be a cloud storage path.
  18             Can also be provided post-initialization by calling this task instance
  19         - parameters (dict, optional): dictionary of parameters to use for the notebook
  20             Can also be provided at runtime
  21         - output_format (str, optional): Notebook output format.
  22             Currently supported: json, html (default: json)
  23         - kernel_name (string, optional): kernel name to run the notebook with.
  24             If not provided, the default kernel will be used.
  25         - **kwargs: additional keyword arguments to pass to the Task constructor
  26     """
  27 
  28     def __init__(
  29         self,
  30         path: str = None,
  31         parameters: dict = None,
  32         output_format: str = "json",
  33         kernel_name: str = None,
  34         **kwargs
  35     ):
  36         self.path = path
  37         self.parameters = parameters
  38         self.output_format = output_format
  39         self.kernel_name = kernel_name
  40         super().__init__(**kwargs)
  41 
  42     @defaults_from_attrs("path", "parameters", "output_format")
  43     def run(
  44         self,
  45         path: str = None,
  46         parameters: dict = None,
  47         output_format: str = None,
  48     ) -> str:
  49         """
  50         Run a Jupyter notebook and output as HTML or JSON
  51 
  52         Args:
  53         - path (string, optional): path to fetch the notebook from; can also be
  54             a cloud storage path
  55         - parameters (dict, optional): dictionary of parameters to use for the notebook
  56         - output_format (str, optional): Notebook output format.
  57             Currently supported: json, html (default: json)
  58         """
  59         nb: nbformat.NotebookNode = pm.execute_notebook(
  60             path, "-", parameters=parameters, kernel_name=self.kernel_name
  61         )
  62         if output_format == "json":
  63             return nbformat.writes(nb)
  64         if output_format == "html":
  65             html_exporter = nbconvert.HTMLExporter()
  66             (body, resources) = html_exporter.from_notebook_node(nb)
  67             return body
  68 
  69         raise NotImplementedError("Notebook output %s not supported", output_format)
  70
  [end of src/prefect/tasks/jupyter/jupyter.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/prefect/tasks/jupyter/jupyter.py b/src/prefect/tasks/jupyter/jupyter.py
  --- a/src/prefect/tasks/jupyter/jupyter.py
  +++ b/src/prefect/tasks/jupyter/jupyter.py
  @@ -18,8 +18,12 @@
               Can also be provided post-initialization by calling this task instance
           - parameters (dict, optional): dictionary of parameters to use for the notebook
               Can also be provided at runtime
  -        - output_format (str, optional): Notebook output format.
  -            Currently supported: json, html (default: json)
  +        - output_format (str, optional): Notebook output format, should be a valid
  +            nbconvert Exporter name. 'json' is treated as 'notebook'.
  +            Valid exporter names: asciidoc, custom, html, latex, markdown,
  +            notebook, pdf, python, rst, script, slides, webpdf. (default: notebook)
  +        - exporter_kwargs (dict, optional): The arguments used for initializing
  +            the exporter.
           - kernel_name (string, optional): kernel name to run the notebook with.
               If not provided, the default kernel will be used.
           - **kwargs: additional keyword arguments to pass to the Task constructor
  @@ -29,7 +33,8 @@
           self,
           path: str = None,
           parameters: dict = None,
  -        output_format: str = "json",
  +        output_format: str = "notebook",
  +        exporter_kwargs: dict = None,
           kernel_name: str = None,
           **kwargs
       ):
  @@ -37,33 +42,40 @@
           self.parameters = parameters
           self.output_format = output_format
           self.kernel_name = kernel_name
  +        self.exporter_kwargs = exporter_kwargs
           super().__init__(**kwargs)
   
  -    @defaults_from_attrs("path", "parameters", "output_format")
  +    @defaults_from_attrs("path", "parameters", "output_format", "exporter_kwargs")
       def run(
           self,
           path: str = None,
           parameters: dict = None,
           output_format: str = None,
  +        exporter_kwargs: dict = None,
       ) -> str:
           """
  -        Run a Jupyter notebook and output as HTML or JSON
  +        Run a Jupyter notebook and output as HTML, notebook, or other formats.
   
           Args:
           - path (string, optional): path to fetch the notebook from; can also be
               a cloud storage path
           - parameters (dict, optional): dictionary of parameters to use for the notebook
  -        - output_format (str, optional): Notebook output format.
  -            Currently supported: json, html (default: json)
  +        - output_format (str, optional): Notebook output format, should be a valid
  +            nbconvert Exporter name. 'json' is treated as 'notebook'.
  +            Valid exporter names: asciidoc, custom, html, latex, markdown,
  +            notebook, pdf, python, rst, script, slides, webpdf. (default: notebook)
  +        - exporter_kwargs (dict, optional): The arguments used for initializing
  +            the exporter.
           """
           nb: nbformat.NotebookNode = pm.execute_notebook(
               path, "-", parameters=parameters, kernel_name=self.kernel_name
           )
           if output_format == "json":
  -            return nbformat.writes(nb)
  -        if output_format == "html":
  -            html_exporter = nbconvert.HTMLExporter()
  -            (body, resources) = html_exporter.from_notebook_node(nb)
  -            return body
  +            output_format = "notebook"
   
  -        raise NotImplementedError("Notebook output %s not supported", output_format)
  +        if exporter_kwargs is None:
  +            exporter_kwargs = {}
  +
  +        exporter = nbconvert.get_exporter(output_format)
  +        body, resources = nbconvert.export(exporter, nb, **exporter_kwargs)
  +        return body
  
verification_info: {"golden_diff": "diff --git a/src/prefect/tasks/jupyter/jupyter.py b/src/prefect/tasks/jupyter/jupyter.py\n--- a/src/prefect/tasks/jupyter/jupyter.py\n+++ b/src/prefect/tasks/jupyter/jupyter.py\n@@ -18,8 +18,12 @@\n             Can also be provided post-initialization by calling this task instance\n         - parameters (dict, optional): dictionary of parameters to use for the notebook\n             Can also be provided at runtime\n-        - output_format (str, optional): Notebook output format.\n-            Currently supported: json, html (default: json)\n+        - output_format (str, optional): Notebook output format, should be a valid\n+            nbconvert Exporter name. 'json' is treated as 'notebook'.\n+            Valid exporter names: asciidoc, custom, html, latex, markdown,\n+            notebook, pdf, python, rst, script, slides, webpdf. (default: notebook)\n+        - exporter_kwargs (dict, optional): The arguments used for initializing\n+            the exporter.\n         - kernel_name (string, optional): kernel name to run the notebook with.\n             If not provided, the default kernel will be used.\n         - **kwargs: additional keyword arguments to pass to the Task constructor\n@@ -29,7 +33,8 @@\n         self,\n         path: str = None,\n         parameters: dict = None,\n-        output_format: str = \"json\",\n+        output_format: str = \"notebook\",\n+        exporter_kwargs: dict = None,\n         kernel_name: str = None,\n         **kwargs\n     ):\n@@ -37,33 +42,40 @@\n         self.parameters = parameters\n         self.output_format = output_format\n         self.kernel_name = kernel_name\n+        self.exporter_kwargs = exporter_kwargs\n         super().__init__(**kwargs)\n \n-    @defaults_from_attrs(\"path\", \"parameters\", \"output_format\")\n+    @defaults_from_attrs(\"path\", \"parameters\", \"output_format\", \"exporter_kwargs\")\n     def run(\n         self,\n         path: str = None,\n         parameters: dict = None,\n         output_format: str = None,\n+        exporter_kwargs: dict = None,\n     ) -> str:\n         \"\"\"\n-        Run a Jupyter notebook and output as HTML or JSON\n+        Run a Jupyter notebook and output as HTML, notebook, or other formats.\n \n         Args:\n         - path (string, optional): path to fetch the notebook from; can also be\n             a cloud storage path\n         - parameters (dict, optional): dictionary of parameters to use for the notebook\n-        - output_format (str, optional): Notebook output format.\n-            Currently supported: json, html (default: json)\n+        - output_format (str, optional): Notebook output format, should be a valid\n+            nbconvert Exporter name. 'json' is treated as 'notebook'.\n+            Valid exporter names: asciidoc, custom, html, latex, markdown,\n+            notebook, pdf, python, rst, script, slides, webpdf. (default: notebook)\n+        - exporter_kwargs (dict, optional): The arguments used for initializing\n+            the exporter.\n         \"\"\"\n         nb: nbformat.NotebookNode = pm.execute_notebook(\n             path, \"-\", parameters=parameters, kernel_name=self.kernel_name\n         )\n         if output_format == \"json\":\n-            return nbformat.writes(nb)\n-        if output_format == \"html\":\n-            html_exporter = nbconvert.HTMLExporter()\n-            (body, resources) = html_exporter.from_notebook_node(nb)\n-            return body\n+            output_format = \"notebook\"\n \n-        raise NotImplementedError(\"Notebook output %s not supported\", output_format)\n+        if exporter_kwargs is None:\n+            exporter_kwargs = {}\n+\n+        exporter = nbconvert.get_exporter(output_format)\n+        body, resources = nbconvert.export(exporter, nb, **exporter_kwargs)\n+        return body\n", "issue": "Allow exporter arguments in Jupyter ExecuteNotebook task\n## Current behavior\r\n\r\nWhen running the `jupyter.jupyter.ExecuteNotebook` task with `output_format='html'` the default settings for the HTMLExporter are used. There is no way to pass arguments to this exporter.\r\n\r\n## Proposed behavior\r\n\r\nAllow passing arguments to the HTMLExporter.\r\n\r\n## Implementation suggestion\r\n\r\nSomething like `html_exporter = nbconvert.HTMLExporter(**exporter_kwargs)` on the following line:\r\nhttps://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/jupyter/jupyter.py#L65\r\n\r\n## Example usecase\r\n\r\nThis allows you to exclude code cells, only showing their output, in the exported html document by passing the `exclude_input=True` argument to the exporter.\n", "before_files": [{"content": "import nbconvert\nimport nbformat\nimport papermill as pm\n\nfrom prefect import Task\nfrom prefect.utilities.tasks import defaults_from_attrs\n\n\nclass ExecuteNotebook(Task):\n    \"\"\"\n    Task for running Jupyter Notebooks.\n    In order to parametrize the notebook, you need to mark the parameters cell as described in\n        the papermill documentation: https://papermill.readthedocs.io/en/latest/usage-parameterize.html\n\n    Args:\n        - path (string, optional): path to fetch the notebook from.\n            Can be a cloud storage path.\n            Can also be provided post-initialization by calling this task instance\n        - parameters (dict, optional): dictionary of parameters to use for the notebook\n            Can also be provided at runtime\n        - output_format (str, optional): Notebook output format.\n            Currently supported: json, html (default: json)\n        - kernel_name (string, optional): kernel name to run the notebook with.\n            If not provided, the default kernel will be used.\n        - **kwargs: additional keyword arguments to pass to the Task constructor\n    \"\"\"\n\n    def __init__(\n        self,\n        path: str = None,\n        parameters: dict = None,\n        output_format: str = \"json\",\n        kernel_name: str = None,\n        **kwargs\n    ):\n        self.path = path\n        self.parameters = parameters\n        self.output_format = output_format\n        self.kernel_name = kernel_name\n        super().__init__(**kwargs)\n\n    @defaults_from_attrs(\"path\", \"parameters\", \"output_format\")\n    def run(\n        self,\n        path: str = None,\n        parameters: dict = None,\n        output_format: str = None,\n    ) -> str:\n        \"\"\"\n        Run a Jupyter notebook and output as HTML or JSON\n\n        Args:\n        - path (string, optional): path to fetch the notebook from; can also be\n            a cloud storage path\n        - parameters (dict, optional): dictionary of parameters to use for the notebook\n        - output_format (str, optional): Notebook output format.\n            Currently supported: json, html (default: json)\n        \"\"\"\n        nb: nbformat.NotebookNode = pm.execute_notebook(\n            path, \"-\", parameters=parameters, kernel_name=self.kernel_name\n        )\n        if output_format == \"json\":\n            return nbformat.writes(nb)\n        if output_format == \"html\":\n            html_exporter = nbconvert.HTMLExporter()\n            (body, resources) = html_exporter.from_notebook_node(nb)\n            return body\n\n        raise NotImplementedError(\"Notebook output %s not supported\", output_format)\n", "path": "src/prefect/tasks/jupyter/jupyter.py"}]}