We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Linting doc config
Currently, `doc/source/conf.py` is not checked with `flake8` in our CI and it contains errors. We need to fix this and make CI check it.

```
$ flake8 docs/source/conf.py
docs/source/conf.py:23:1: F401 'torch' imported but unused
docs/source/conf.py:24:1: F401 'torchaudio' imported but unused
docs/source/conf.py:138:1: E302 expected 2 blank lines, found 1
docs/source/conf.py:229:5: F821 undefined name 'List'
docs/source/conf.py:229:5: F821 undefined name 'unicode'
docs/source/conf.py:229:5: F821 undefined name 'Tuple'
```

## Steps
1. Fix the above error.
2. Add `docs/source/conf.py` [here](https://github.com/pytorch/audio/blob/ea857940de9e3738166989ad3bf1726741a13f04/.circleci/unittest/linux/scripts/run_style_checks.sh#L32)

## Build and testing

For setting up dev env, please refer to [CONTRIBUTING.md](https://github.com/pytorch/audio/blob/master/CONTRIBUTING.md).


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docs/source/conf.py`
Content:
```
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 #
4 # PyTorch documentation build configuration file, created by
5 # sphinx-quickstart on Fri Dec 23 13:31:47 2016.
6 #
7 # This file is execfile()d with the current directory set to its
8 # containing dir.
9 #
10 # Note that not all possible configuration values are present in this
11 # autogenerated file.
12 #
13 # All configuration values have a default; values that are commented out
14 # serve to show the default.
15 
16 # If extensions (or modules to document with autodoc) are in another directory,
17 # add these directories to sys.path here. If the directory is relative to the
18 # documentation root, use os.path.abspath to make it absolute, like shown here.
19 #
20 # import os
21 # import sys
22 # sys.path.insert(0, os.path.abspath('.'))
23 import torch
24 import torchaudio
25 import pytorch_sphinx_theme
26 
27 # -- General configuration ------------------------------------------------
28 
29 # If your documentation needs a minimal Sphinx version, state it here.
30 #
31 needs_sphinx = '1.6'
32 
33 # Add any Sphinx extension module names here, as strings. They can be
34 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35 # ones.
36 extensions = [
37     'sphinx.ext.autodoc',
38     'sphinx.ext.autosummary',
39     'sphinx.ext.doctest',
40     'sphinx.ext.intersphinx',
41     'sphinx.ext.todo',
42     'sphinx.ext.coverage',
43     'sphinx.ext.napoleon',
44     'sphinx.ext.viewcode',
45     'sphinxcontrib.katex',
46 ]
47 
48 # katex options
49 #
50 #
51 
52 katex_options = r'''
53 delimiters : [
54    {left: "$$", right: "$$", display: true},
55    {left: "\\(", right: "\\)", display: false},
56    {left: "\\[", right: "\\]", display: true}
57 ]
58 '''
59 
60 napoleon_use_ivar = True
61 napoleon_numpy_docstring = False
62 napoleon_google_docstring = True
63 
64 # Add any paths that contain templates here, relative to this directory.
65 templates_path = ['_templates']
66 
67 # The suffix(es) of source filenames.
68 # You can specify multiple suffix as a list of string:
69 #
70 # source_suffix = ['.rst', '.md']
71 source_suffix = '.rst'
72 
73 # The master toctree document.
74 master_doc = 'index'
75 
76 # General information about the project.
77 project = 'Torchaudio'
78 copyright = '2018, Torchaudio Contributors'
79 author = 'Torchaudio Contributors'
80 
81 # The version info for the project you're documenting, acts as replacement for
82 # |version| and |release|, also used in various other places throughout the
83 # built documents.
84 #
85 # The short X.Y version.
86 # TODO: change to [:2] at v1.0
87 version = 'master '
88 # The full version, including alpha/beta/rc tags.
89 # TODO: verify this works as expected
90 release = 'master'
91 
92 # The language for content autogenerated by Sphinx. Refer to documentation
93 # for a list of supported languages.
94 #
95 # This is also used if you do content translation via gettext catalogs.
96 # Usually you set "language" from the command line for these cases.
97 language = None
98 
99 # List of patterns, relative to source directory, that match files and
100 # directories to ignore when looking for source files.
101 # This patterns also effect to html_static_path and html_extra_path
102 exclude_patterns = []
103 
104 # The name of the Pygments (syntax highlighting) style to use.
105 pygments_style = 'sphinx'
106 
107 # If true, `todo` and `todoList` produce output, else they produce nothing.
108 todo_include_todos = True
109 
110 
111 # -- Options for HTML output ----------------------------------------------
112 
113 # The theme to use for HTML and HTML Help pages.  See the documentation for
114 # a list of builtin themes.
115 #
116 html_theme = 'pytorch_sphinx_theme'
117 html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
118 
119 # Theme options are theme-specific and customize the look and feel of a theme
120 # further.  For a list of options available for each theme, see the
121 # documentation.
122 #
123 html_theme_options = {
124     'pytorch_project': 'audio',
125     'collapse_navigation': False,
126     'display_version': True,
127     'logo_only': True,
128     'navigation_with_keys': True
129 }
130 
131 html_logo = '_static/img/pytorch-logo-dark.svg'
132 
133 # Add any paths that contain custom static files (such as style sheets) here,
134 # relative to this directory. They are copied after the builtin static files,
135 # so a file named "default.css" will overwrite the builtin "default.css".
136 html_static_path = ['_static']
137 
138 def setup(app):
139     # NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value
140     # and can be moved outside of this function (and the setup(app) function
141     # can be deleted).
142     html_css_files = [
143         'https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css'
144     ]
145 
146     # In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is
147     # `add_stylesheet` (deprecated in 1.8).
148     add_css = getattr(app, 'add_css_file', getattr(app, 'add_stylesheet'))
149     for css_file in html_css_files:
150         add_css(css_file)
151 
152 
153 # -- Options for HTMLHelp output ------------------------------------------
154 
155 # Output file base name for HTML help builder.
156 htmlhelp_basename = 'TorchAudiodoc'
157 
158 
159 # -- Options for LaTeX output ---------------------------------------------
160 
161 latex_elements = {
162     # The paper size ('letterpaper' or 'a4paper').
163     #
164     # 'papersize': 'letterpaper',
165 
166     # The font size ('10pt', '11pt' or '12pt').
167     #
168     # 'pointsize': '10pt',
169 
170     # Additional stuff for the LaTeX preamble.
171     #
172     # 'preamble': '',
173 
174     # Latex figure (float) alignment
175     #
176     # 'figure_align': 'htbp',
177 }
178 
179 # Grouping the document tree into LaTeX files. List of tuples
180 # (source start file, target name, title,
181 #  author, documentclass [howto, manual, or own class]).
182 latex_documents = [
183     (master_doc, 'pytorch.tex', 'Torchaudio Documentation',
184      'Torch Contributors', 'manual'),
185 ]
186 
187 
188 # -- Options for manual page output ---------------------------------------
189 
190 # One entry per manual page. List of tuples
191 # (source start file, name, description, authors, manual section).
192 man_pages = [
193     (master_doc, 'Torchaudio', 'Torchaudio Documentation',
194      [author], 1)
195 ]
196 
197 
198 # -- Options for Texinfo output -------------------------------------------
199 
200 # Grouping the document tree into Texinfo files. List of tuples
201 # (source start file, target name, title, author,
202 #  dir menu entry, description, category)
203 texinfo_documents = [
204     (master_doc, 'Torchaudio', 'Torchaudio Documentation',
205      author, 'Torchaudio', 'Load audio files into pytorch tensors.',
206      'Miscellaneous'),
207 ]
208 
209 
210 # Example configuration for intersphinx: refer to the Python standard library.
211 intersphinx_mapping = {
212     'python': ('https://docs.python.org/', None),
213     'numpy': ('https://docs.scipy.org/doc/numpy/', None),
214     'torch': ('https://pytorch.org/docs/stable/', None),
215 }
216 
217 # -- A patch that prevents Sphinx from cross-referencing ivar tags -------
218 # See http://stackoverflow.com/a/41184353/3343043
219 
220 from docutils import nodes
221 from sphinx.util.docfields import TypedField
222 from sphinx import addnodes
223 
224 
225 def patched_make_field(self, types, domain, items, **kw):
226     # `kw` catches `env=None` needed for newer sphinx while maintaining
227     #  backwards compatibility when passed along further down!
228 
229     # type: (List, unicode, Tuple) -> nodes.field
230     def handle_item(fieldarg, content):
231         par = nodes.paragraph()
232         par += addnodes.literal_strong('', fieldarg)  # Patch: this line added
233         # par.extend(self.make_xrefs(self.rolename, domain, fieldarg,
234         #                           addnodes.literal_strong))
235         if fieldarg in types:
236             par += nodes.Text(' (')
237             # NOTE: using .pop() here to prevent a single type node to be
238             # inserted twice into the doctree, which leads to
239             # inconsistencies later when references are resolved
240             fieldtype = types.pop(fieldarg)
241             if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text):
242                 typename = u''.join(n.astext() for n in fieldtype)
243                 typename = typename.replace('int', 'python:int')
244                 typename = typename.replace('long', 'python:long')
245                 typename = typename.replace('float', 'python:float')
246                 typename = typename.replace('type', 'python:type')
247                 par.extend(self.make_xrefs(self.typerolename, domain, typename,
248                                            addnodes.literal_emphasis, **kw))
249             else:
250                 par += fieldtype
251             par += nodes.Text(')')
252         par += nodes.Text(' -- ')
253         par += content
254         return par
255 
256     fieldname = nodes.field_name('', self.label)
257     if len(items) == 1 and self.can_collapse:
258         fieldarg, content = items[0]
259         bodynode = handle_item(fieldarg, content)
260     else:
261         bodynode = self.list_type()
262         for fieldarg, content in items:
263             bodynode += nodes.list_item('', handle_item(fieldarg, content))
264     fieldbody = nodes.field_body('', bodynode)
265     return nodes.field('', fieldname, fieldbody)
266 
267 TypedField.make_field = patched_make_field
268
```
--- 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()

```

diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -20,8 +20,6 @@
 # import os
 # import sys
 # sys.path.insert(0, os.path.abspath('.'))
-import torch
-import torchaudio
 import pytorch_sphinx_theme
 
 # -- General configuration ------------------------------------------------
@@ -135,6 +133,7 @@
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
+
 def setup(app):
     # NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value
     # and can be moved outside of this function (and the setup(app) function
@@ -145,7 +144,7 @@
 
     # In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is
     # `add_stylesheet` (deprecated in 1.8).
-    add_css = getattr(app, 'add_css_file', getattr(app, 'add_stylesheet'))
+    add_css = getattr(app, 'add_css_file', app.add_stylesheet)
     for css_file in html_css_files:
         add_css(css_file)
 
@@ -226,7 +225,7 @@
     # `kw` catches `env=None` needed for newer sphinx while maintaining
     #  backwards compatibility when passed along further down!
 
-    # type: (List, unicode, Tuple) -> nodes.field
+    # type: (list, str, tuple) -> nodes.field
     def handle_item(fieldarg, content):
         par = nodes.paragraph()
         par += addnodes.literal_strong('', fieldarg)  # Patch: this line added

{"golden_diff": "diff --git a/docs/source/conf.py b/docs/source/conf.py\n--- a/docs/source/conf.py\n+++ b/docs/source/conf.py\n@@ -20,8 +20,6 @@\n # import os\n # import sys\n # sys.path.insert(0, os.path.abspath('.'))\n-import torch\n-import torchaudio\n import pytorch_sphinx_theme\n \n # -- General configuration ------------------------------------------------\n@@ -135,6 +133,7 @@\n # so a file named \"default.css\" will overwrite the builtin \"default.css\".\n html_static_path = ['_static']\n \n+\n def setup(app):\n     # NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value\n     # and can be moved outside of this function (and the setup(app) function\n@@ -145,7 +144,7 @@\n \n     # In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is\n     # `add_stylesheet` (deprecated in 1.8).\n-    add_css = getattr(app, 'add_css_file', getattr(app, 'add_stylesheet'))\n+    add_css = getattr(app, 'add_css_file', app.add_stylesheet)\n     for css_file in html_css_files:\n         add_css(css_file)\n \n@@ -226,7 +225,7 @@\n     # `kw` catches `env=None` needed for newer sphinx while maintaining\n     #  backwards compatibility when passed along further down!\n \n-    # type: (List, unicode, Tuple) -> nodes.field\n+    # type: (list, str, tuple) -> nodes.field\n     def handle_item(fieldarg, content):\n         par = nodes.paragraph()\n         par += addnodes.literal_strong('', fieldarg)  # Patch: this line added\n", "issue": "Linting doc config\nCurrently, `doc/source/conf.py` is not checked with `flake8` in our CI and it contains errors. We need to fix this and make CI check it.\r\n\r\n```\r\n$ flake8 docs/source/conf.py\r\ndocs/source/conf.py:23:1: F401 'torch' imported but unused\r\ndocs/source/conf.py:24:1: F401 'torchaudio' imported but unused\r\ndocs/source/conf.py:138:1: E302 expected 2 blank lines, found 1\r\ndocs/source/conf.py:229:5: F821 undefined name 'List'\r\ndocs/source/conf.py:229:5: F821 undefined name 'unicode'\r\ndocs/source/conf.py:229:5: F821 undefined name 'Tuple'\r\n```\r\n\r\n## Steps\r\n1. Fix the above error.\r\n2. Add `docs/source/conf.py` [here](https://github.com/pytorch/audio/blob/ea857940de9e3738166989ad3bf1726741a13f04/.circleci/unittest/linux/scripts/run_style_checks.sh#L32)\r\n\r\n## Build and testing\r\n\r\nFor setting up dev env, please refer to [CONTRIBUTING.md](https://github.com/pytorch/audio/blob/master/CONTRIBUTING.md).\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# PyTorch documentation build configuration file, created by\n# sphinx-quickstart on Fri Dec 23 13:31:47 2016.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\n# import os\n# import sys\n# sys.path.insert(0, os.path.abspath('.'))\nimport torch\nimport torchaudio\nimport pytorch_sphinx_theme\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\nneeds_sphinx = '1.6'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.autosummary',\n    'sphinx.ext.doctest',\n    'sphinx.ext.intersphinx',\n    'sphinx.ext.todo',\n    'sphinx.ext.coverage',\n    'sphinx.ext.napoleon',\n    'sphinx.ext.viewcode',\n    'sphinxcontrib.katex',\n]\n\n# katex options\n#\n#\n\nkatex_options = r'''\ndelimiters : [\n   {left: \"$$\", right: \"$$\", display: true},\n   {left: \"\\\\(\", right: \"\\\\)\", display: false},\n   {left: \"\\\\[\", right: \"\\\\]\", display: true}\n]\n'''\n\nnapoleon_use_ivar = True\nnapoleon_numpy_docstring = False\nnapoleon_google_docstring = True\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'Torchaudio'\ncopyright = '2018, Torchaudio Contributors'\nauthor = 'Torchaudio Contributors'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\n# TODO: change to [:2] at v1.0\nversion = 'master '\n# The full version, including alpha/beta/rc tags.\n# TODO: verify this works as expected\nrelease = 'master'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This patterns also effect to html_static_path and html_extra_path\nexclude_patterns = []\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = True\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = 'pytorch_sphinx_theme'\nhtml_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#\nhtml_theme_options = {\n    'pytorch_project': 'audio',\n    'collapse_navigation': False,\n    'display_version': True,\n    'logo_only': True,\n    'navigation_with_keys': True\n}\n\nhtml_logo = '_static/img/pytorch-logo-dark.svg'\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\ndef setup(app):\n    # NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value\n    # and can be moved outside of this function (and the setup(app) function\n    # can be deleted).\n    html_css_files = [\n        'https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css'\n    ]\n\n    # In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is\n    # `add_stylesheet` (deprecated in 1.8).\n    add_css = getattr(app, 'add_css_file', getattr(app, 'add_stylesheet'))\n    for css_file in html_css_files:\n        add_css(css_file)\n\n\n# -- Options for HTMLHelp output ------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'TorchAudiodoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #\n    # 'papersize': 'letterpaper',\n\n    # The font size ('10pt', '11pt' or '12pt').\n    #\n    # 'pointsize': '10pt',\n\n    # Additional stuff for the LaTeX preamble.\n    #\n    # 'preamble': '',\n\n    # Latex figure (float) alignment\n    #\n    # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    (master_doc, 'pytorch.tex', 'Torchaudio Documentation',\n     'Torch Contributors', 'manual'),\n]\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    (master_doc, 'Torchaudio', 'Torchaudio Documentation',\n     [author], 1)\n]\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    (master_doc, 'Torchaudio', 'Torchaudio Documentation',\n     author, 'Torchaudio', 'Load audio files into pytorch tensors.',\n     'Miscellaneous'),\n]\n\n\n# Example configuration for intersphinx: refer to the Python standard library.\nintersphinx_mapping = {\n    'python': ('https://docs.python.org/', None),\n    'numpy': ('https://docs.scipy.org/doc/numpy/', None),\n    'torch': ('https://pytorch.org/docs/stable/', None),\n}\n\n# -- A patch that prevents Sphinx from cross-referencing ivar tags -------\n# See http://stackoverflow.com/a/41184353/3343043\n\nfrom docutils import nodes\nfrom sphinx.util.docfields import TypedField\nfrom sphinx import addnodes\n\n\ndef patched_make_field(self, types, domain, items, **kw):\n    # `kw` catches `env=None` needed for newer sphinx while maintaining\n    #  backwards compatibility when passed along further down!\n\n    # type: (List, unicode, Tuple) -> nodes.field\n    def handle_item(fieldarg, content):\n        par = nodes.paragraph()\n        par += addnodes.literal_strong('', fieldarg)  # Patch: this line added\n        # par.extend(self.make_xrefs(self.rolename, domain, fieldarg,\n        #                           addnodes.literal_strong))\n        if fieldarg in types:\n            par += nodes.Text(' (')\n            # NOTE: using .pop() here to prevent a single type node to be\n            # inserted twice into the doctree, which leads to\n            # inconsistencies later when references are resolved\n            fieldtype = types.pop(fieldarg)\n            if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text):\n                typename = u''.join(n.astext() for n in fieldtype)\n                typename = typename.replace('int', 'python:int')\n                typename = typename.replace('long', 'python:long')\n                typename = typename.replace('float', 'python:float')\n                typename = typename.replace('type', 'python:type')\n                par.extend(self.make_xrefs(self.typerolename, domain, typename,\n                                           addnodes.literal_emphasis, **kw))\n            else:\n                par += fieldtype\n            par += nodes.Text(')')\n        par += nodes.Text(' -- ')\n        par += content\n        return par\n\n    fieldname = nodes.field_name('', self.label)\n    if len(items) == 1 and self.can_collapse:\n        fieldarg, content = items[0]\n        bodynode = handle_item(fieldarg, content)\n    else:\n        bodynode = self.list_type()\n        for fieldarg, content in items:\n            bodynode += nodes.list_item('', handle_item(fieldarg, content))\n    fieldbody = nodes.field_body('', bodynode)\n    return nodes.field('', fieldname, fieldbody)\n\nTypedField.make_field = patched_make_field\n", "path": "docs/source/conf.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# PyTorch documentation build configuration file, created by\n# sphinx-quickstart on Fri Dec 23 13:31:47 2016.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\n# import os\n# import sys\n# sys.path.insert(0, os.path.abspath('.'))\nimport pytorch_sphinx_theme\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\nneeds_sphinx = '1.6'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.autosummary',\n    'sphinx.ext.doctest',\n    'sphinx.ext.intersphinx',\n    'sphinx.ext.todo',\n    'sphinx.ext.coverage',\n    'sphinx.ext.napoleon',\n    'sphinx.ext.viewcode',\n    'sphinxcontrib.katex',\n]\n\n# katex options\n#\n#\n\nkatex_options = r'''\ndelimiters : [\n   {left: \"$$\", right: \"$$\", display: true},\n   {left: \"\\\\(\", right: \"\\\\)\", display: false},\n   {left: \"\\\\[\", right: \"\\\\]\", display: true}\n]\n'''\n\nnapoleon_use_ivar = True\nnapoleon_numpy_docstring = False\nnapoleon_google_docstring = True\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'Torchaudio'\ncopyright = '2018, Torchaudio Contributors'\nauthor = 'Torchaudio Contributors'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\n# TODO: change to [:2] at v1.0\nversion = 'master '\n# The full version, including alpha/beta/rc tags.\n# TODO: verify this works as expected\nrelease = 'master'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This patterns also effect to html_static_path and html_extra_path\nexclude_patterns = []\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = True\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = 'pytorch_sphinx_theme'\nhtml_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#\nhtml_theme_options = {\n    'pytorch_project': 'audio',\n    'collapse_navigation': False,\n    'display_version': True,\n    'logo_only': True,\n    'navigation_with_keys': True\n}\n\nhtml_logo = '_static/img/pytorch-logo-dark.svg'\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n\ndef setup(app):\n    # NOTE: in Sphinx 1.8+ `html_css_files` is an official configuration value\n    # and can be moved outside of this function (and the setup(app) function\n    # can be deleted).\n    html_css_files = [\n        'https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css'\n    ]\n\n    # In Sphinx 1.8 it was renamed to `add_css_file`, 1.7 and prior it is\n    # `add_stylesheet` (deprecated in 1.8).\n    add_css = getattr(app, 'add_css_file', app.add_stylesheet)\n    for css_file in html_css_files:\n        add_css(css_file)\n\n\n# -- Options for HTMLHelp output ------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'TorchAudiodoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #\n    # 'papersize': 'letterpaper',\n\n    # The font size ('10pt', '11pt' or '12pt').\n    #\n    # 'pointsize': '10pt',\n\n    # Additional stuff for the LaTeX preamble.\n    #\n    # 'preamble': '',\n\n    # Latex figure (float) alignment\n    #\n    # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    (master_doc, 'pytorch.tex', 'Torchaudio Documentation',\n     'Torch Contributors', 'manual'),\n]\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    (master_doc, 'Torchaudio', 'Torchaudio Documentation',\n     [author], 1)\n]\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    (master_doc, 'Torchaudio', 'Torchaudio Documentation',\n     author, 'Torchaudio', 'Load audio files into pytorch tensors.',\n     'Miscellaneous'),\n]\n\n\n# Example configuration for intersphinx: refer to the Python standard library.\nintersphinx_mapping = {\n    'python': ('https://docs.python.org/', None),\n    'numpy': ('https://docs.scipy.org/doc/numpy/', None),\n    'torch': ('https://pytorch.org/docs/stable/', None),\n}\n\n# -- A patch that prevents Sphinx from cross-referencing ivar tags -------\n# See http://stackoverflow.com/a/41184353/3343043\n\nfrom docutils import nodes\nfrom sphinx.util.docfields import TypedField\nfrom sphinx import addnodes\n\n\ndef patched_make_field(self, types, domain, items, **kw):\n    # `kw` catches `env=None` needed for newer sphinx while maintaining\n    #  backwards compatibility when passed along further down!\n\n    # type: (list, str, tuple) -> nodes.field\n    def handle_item(fieldarg, content):\n        par = nodes.paragraph()\n        par += addnodes.literal_strong('', fieldarg)  # Patch: this line added\n        # par.extend(self.make_xrefs(self.rolename, domain, fieldarg,\n        #                           addnodes.literal_strong))\n        if fieldarg in types:\n            par += nodes.Text(' (')\n            # NOTE: using .pop() here to prevent a single type node to be\n            # inserted twice into the doctree, which leads to\n            # inconsistencies later when references are resolved\n            fieldtype = types.pop(fieldarg)\n            if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text):\n                typename = u''.join(n.astext() for n in fieldtype)\n                typename = typename.replace('int', 'python:int')\n                typename = typename.replace('long', 'python:long')\n                typename = typename.replace('float', 'python:float')\n                typename = typename.replace('type', 'python:type')\n                par.extend(self.make_xrefs(self.typerolename, domain, typename,\n                                           addnodes.literal_emphasis, **kw))\n            else:\n                par += fieldtype\n            par += nodes.Text(')')\n        par += nodes.Text(' -- ')\n        par += content\n        return par\n\n    fieldname = nodes.field_name('', self.label)\n    if len(items) == 1 and self.can_collapse:\n        fieldarg, content = items[0]\n        bodynode = handle_item(fieldarg, content)\n    else:\n        bodynode = self.list_type()\n        for fieldarg, content in items:\n            bodynode += nodes.list_item('', handle_item(fieldarg, content))\n    fieldbody = nodes.field_body('', bodynode)\n    return nodes.field('', fieldname, fieldbody)\n\nTypedField.make_field = patched_make_field\n", "path": "docs/source/conf.py"}]}