We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Consider deprecating Python 3.6
Hello!

Python 3.6 is approaching its End Of Life on December 23rd, and we should consider dropping support for Python 3.6 accordingly. In particular, this involves modifying:
* CI tests
* `python_requires` in `setup.py`.
* Lots of documentation throughout the project.

Among other places, I'm sure.

- Tom Aarsen
Add CI tests for Python 3.10
Hello!

Python 3.10 is no longer a glimmer far into the future, and we should start supporting it. The first step in doing so is adding 3.10 to the CI tests, and mentioning that NLTK works for Python 3.10 in our documentation throughout the project.

- Tom Aarsen

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 #
3 # Setup script for the Natural Language Toolkit
4 #
5 # Copyright (C) 2001-2021 NLTK Project
6 # Author: NLTK Team <nltk.team@gmail.com>
7 # URL: <https://www.nltk.org/>
8 # For license information, see LICENSE.TXT
9 
10 # Work around mbcs bug in distutils.
11 # https://bugs.python.org/issue10945
12 import codecs
13 
14 try:
15     codecs.lookup("mbcs")
16 except LookupError:
17     ascii = codecs.lookup("ascii")
18     func = lambda name, enc=ascii: {True: enc}.get(name == "mbcs")
19     codecs.register(func)
20 
21 import os
22 
23 # Use the VERSION file to get NLTK version
24 version_file = os.path.join(os.path.dirname(__file__), "nltk", "VERSION")
25 with open(version_file) as fh:
26     nltk_version = fh.read().strip()
27 
28 # setuptools
29 from setuptools import find_packages, setup
30 
31 # Specify groups of optional dependencies
32 extras_require = {
33     "machine_learning": [
34         "numpy",
35         "python-crfsuite",
36         "scikit-learn",
37         "scipy",
38     ],
39     "plot": ["matplotlib"],
40     "tgrep": ["pyparsing"],
41     "twitter": ["twython"],
42     "corenlp": ["requests"],
43 }
44 
45 # Add a group made up of all optional dependencies
46 extras_require["all"] = {
47     package for group in extras_require.values() for package in group
48 }
49 
50 # Adds CLI commands
51 console_scripts = """
52 [console_scripts]
53 nltk=nltk.cli:cli
54 """
55 
56 _project_homepage = "https://www.nltk.org/"
57 
58 setup(
59     name="nltk",
60     description="Natural Language Toolkit",
61     version=nltk_version,
62     url=_project_homepage,
63     project_urls={
64         "Documentation": _project_homepage,
65         "Source Code": "https://github.com/nltk/nltk",
66         "Issue Tracker": "https://github.com/nltk/nltk/issues",
67     },
68     long_description="""\
69 The Natural Language Toolkit (NLTK) is a Python package for
70 natural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9.""",
71     license="Apache License, Version 2.0",
72     keywords=[
73         "NLP",
74         "CL",
75         "natural language processing",
76         "computational linguistics",
77         "parsing",
78         "tagging",
79         "tokenizing",
80         "syntax",
81         "linguistics",
82         "language",
83         "natural language",
84         "text analytics",
85     ],
86     maintainer="NLTK Team",
87     maintainer_email="nltk.team@gmail.com",
88     author="NLTK Team",
89     author_email="nltk.team@gmail.com",
90     classifiers=[
91         "Development Status :: 5 - Production/Stable",
92         "Intended Audience :: Developers",
93         "Intended Audience :: Education",
94         "Intended Audience :: Information Technology",
95         "Intended Audience :: Science/Research",
96         "License :: OSI Approved :: Apache Software License",
97         "Operating System :: OS Independent",
98         "Programming Language :: Python :: 3.6",
99         "Programming Language :: Python :: 3.7",
100         "Programming Language :: Python :: 3.8",
101         "Programming Language :: Python :: 3.9",
102         "Topic :: Scientific/Engineering",
103         "Topic :: Scientific/Engineering :: Artificial Intelligence",
104         "Topic :: Scientific/Engineering :: Human Machine Interfaces",
105         "Topic :: Scientific/Engineering :: Information Analysis",
106         "Topic :: Text Processing",
107         "Topic :: Text Processing :: Filters",
108         "Topic :: Text Processing :: General",
109         "Topic :: Text Processing :: Indexing",
110         "Topic :: Text Processing :: Linguistic",
111     ],
112     package_data={"nltk": ["test/*.doctest", "VERSION"]},
113     python_requires=">=3.6",
114     install_requires=[
115         "click",
116         "joblib",
117         "regex>=2021.8.3",
118         "tqdm",
119     ],
120     extras_require=extras_require,
121     packages=find_packages(),
122     zip_safe=False,  # since normal files will be present too?
123     entry_points=console_scripts,
124 )
125
```

Path: `nltk/__init__.py`
Content:
```
1 # Natural Language Toolkit (NLTK)
2 #
3 # Copyright (C) 2001-2021 NLTK Project
4 # Authors: Steven Bird <stevenbird1@gmail.com>
5 #          Edward Loper <edloper@gmail.com>
6 # URL: <https://www.nltk.org/>
7 # For license information, see LICENSE.TXT
8 
9 """
10 The Natural Language Toolkit (NLTK) is an open source Python library
11 for Natural Language Processing.  A free online book is available.
12 (If you use the library for academic research, please cite the book.)
13 
14 Steven Bird, Ewan Klein, and Edward Loper (2009).
15 Natural Language Processing with Python.  O'Reilly Media Inc.
16 https://www.nltk.org/book/
17 
18 isort:skip_file
19 """
20 
21 import os
22 
23 # //////////////////////////////////////////////////////
24 # Metadata
25 # //////////////////////////////////////////////////////
26 
27 # Version.  For each new release, the version number should be updated
28 # in the file VERSION.
29 try:
30     # If a VERSION file exists, use it!
31     version_file = os.path.join(os.path.dirname(__file__), "VERSION")
32     with open(version_file) as infile:
33         __version__ = infile.read().strip()
34 except NameError:
35     __version__ = "unknown (running code interactively?)"
36 except OSError as ex:
37     __version__ = "unknown (%s)" % ex
38 
39 if __doc__ is not None:  # fix for the ``python -OO``
40     __doc__ += "\n@version: " + __version__
41 
42 
43 # Copyright notice
44 __copyright__ = """\
45 Copyright (C) 2001-2021 NLTK Project.
46 
47 Distributed and Licensed under the Apache License, Version 2.0,
48 which is included by reference.
49 """
50 
51 __license__ = "Apache License, Version 2.0"
52 # Description of the toolkit, keywords, and the project's primary URL.
53 __longdescr__ = """\
54 The Natural Language Toolkit (NLTK) is a Python package for
55 natural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9."""
56 __keywords__ = [
57     "NLP",
58     "CL",
59     "natural language processing",
60     "computational linguistics",
61     "parsing",
62     "tagging",
63     "tokenizing",
64     "syntax",
65     "linguistics",
66     "language",
67     "natural language",
68     "text analytics",
69 ]
70 __url__ = "https://www.nltk.org/"
71 
72 # Maintainer, contributors, etc.
73 __maintainer__ = "NLTK Team"
74 __maintainer_email__ = "nltk.team@gmail.com"
75 __author__ = __maintainer__
76 __author_email__ = __maintainer_email__
77 
78 # "Trove" classifiers for Python Package Index.
79 __classifiers__ = [
80     "Development Status :: 5 - Production/Stable",
81     "Intended Audience :: Developers",
82     "Intended Audience :: Education",
83     "Intended Audience :: Information Technology",
84     "Intended Audience :: Science/Research",
85     "License :: OSI Approved :: Apache Software License",
86     "Operating System :: OS Independent",
87     "Programming Language :: Python :: 3.6",
88     "Programming Language :: Python :: 3.7",
89     "Programming Language :: Python :: 3.8",
90     "Programming Language :: Python :: 3.9",
91     "Topic :: Scientific/Engineering",
92     "Topic :: Scientific/Engineering :: Artificial Intelligence",
93     "Topic :: Scientific/Engineering :: Human Machine Interfaces",
94     "Topic :: Scientific/Engineering :: Information Analysis",
95     "Topic :: Text Processing",
96     "Topic :: Text Processing :: Filters",
97     "Topic :: Text Processing :: General",
98     "Topic :: Text Processing :: Indexing",
99     "Topic :: Text Processing :: Linguistic",
100 ]
101 
102 from nltk.internals import config_java
103 
104 # support numpy from pypy
105 try:
106     import numpypy
107 except ImportError:
108     pass
109 
110 # Override missing methods on environments where it cannot be used like GAE.
111 import subprocess
112 
113 if not hasattr(subprocess, "PIPE"):
114 
115     def _fake_PIPE(*args, **kwargs):
116         raise NotImplementedError("subprocess.PIPE is not supported.")
117 
118     subprocess.PIPE = _fake_PIPE
119 if not hasattr(subprocess, "Popen"):
120 
121     def _fake_Popen(*args, **kwargs):
122         raise NotImplementedError("subprocess.Popen is not supported.")
123 
124     subprocess.Popen = _fake_Popen
125 
126 ###########################################################
127 # TOP-LEVEL MODULES
128 ###########################################################
129 
130 # Import top-level functionality into top-level namespace
131 
132 from nltk.collocations import *
133 from nltk.decorators import decorator, memoize
134 from nltk.featstruct import *
135 from nltk.grammar import *
136 from nltk.probability import *
137 from nltk.text import *
138 from nltk.util import *
139 from nltk.jsontags import *
140 
141 ###########################################################
142 # PACKAGES
143 ###########################################################
144 
145 from nltk.chunk import *
146 from nltk.classify import *
147 from nltk.inference import *
148 from nltk.metrics import *
149 from nltk.parse import *
150 from nltk.tag import *
151 from nltk.tokenize import *
152 from nltk.translate import *
153 from nltk.tree import *
154 from nltk.sem import *
155 from nltk.stem import *
156 
157 # Packages which can be lazily imported
158 # (a) we don't import *
159 # (b) they're slow to import or have run-time dependencies
160 #     that can safely fail at run time
161 
162 from nltk import lazyimport
163 
164 app = lazyimport.LazyModule("nltk.app", locals(), globals())
165 chat = lazyimport.LazyModule("nltk.chat", locals(), globals())
166 corpus = lazyimport.LazyModule("nltk.corpus", locals(), globals())
167 draw = lazyimport.LazyModule("nltk.draw", locals(), globals())
168 toolbox = lazyimport.LazyModule("nltk.toolbox", locals(), globals())
169 
170 # Optional loading
171 
172 try:
173     import numpy
174 except ImportError:
175     pass
176 else:
177     from nltk import cluster
178 
179 from nltk.downloader import download, download_shell
180 
181 try:
182     import tkinter
183 except ImportError:
184     pass
185 else:
186     try:
187         from nltk.downloader import download_gui
188     except RuntimeError as e:
189         import warnings
190 
191         warnings.warn(
192             "Corpus downloader GUI not loaded "
193             "(RuntimeError during import: %s)" % str(e)
194         )
195 
196 # explicitly import all top-level modules (ensuring
197 # they override the same names inadvertently imported
198 # from a subpackage)
199 
200 from nltk import ccg, chunk, classify, collocations
201 from nltk import data, featstruct, grammar, help, inference, metrics
202 from nltk import misc, parse, probability, sem, stem, wsd
203 from nltk import tag, tbl, text, tokenize, translate, tree, util
204 
205 
206 # FIXME:  override any accidentally imported demo, see https://github.com/nltk/nltk/issues/2116
207 def demo():
208     print("To run the demo code for a module, type nltk.module.demo()")
209
```
--- 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/nltk/__init__.py b/nltk/__init__.py
--- a/nltk/__init__.py
+++ b/nltk/__init__.py
@@ -52,7 +52,7 @@
 # Description of the toolkit, keywords, and the project's primary URL.
 __longdescr__ = """\
 The Natural Language Toolkit (NLTK) is a Python package for
-natural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9."""
+natural language processing.  NLTK requires Python 3.7, 3.8, 3.9 or 3.10."""
 __keywords__ = [
     "NLP",
     "CL",
@@ -84,10 +84,10 @@
     "Intended Audience :: Science/Research",
     "License :: OSI Approved :: Apache Software License",
     "Operating System :: OS Independent",
-    "Programming Language :: Python :: 3.6",
     "Programming Language :: Python :: 3.7",
     "Programming Language :: Python :: 3.8",
     "Programming Language :: Python :: 3.9",
+    "Programming Language :: Python :: 3.10",
     "Topic :: Scientific/Engineering",
     "Topic :: Scientific/Engineering :: Artificial Intelligence",
     "Topic :: Scientific/Engineering :: Human Machine Interfaces",
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -67,7 +67,7 @@
     },
     long_description="""\
 The Natural Language Toolkit (NLTK) is a Python package for
-natural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9.""",
+natural language processing.  NLTK requires Python 3.7, 3.8, 3.9 or 3.10.""",
     license="Apache License, Version 2.0",
     keywords=[
         "NLP",
@@ -95,10 +95,10 @@
         "Intended Audience :: Science/Research",
         "License :: OSI Approved :: Apache Software License",
         "Operating System :: OS Independent",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
         "Topic :: Scientific/Engineering",
         "Topic :: Scientific/Engineering :: Artificial Intelligence",
         "Topic :: Scientific/Engineering :: Human Machine Interfaces",
@@ -110,7 +110,7 @@
         "Topic :: Text Processing :: Linguistic",
     ],
     package_data={"nltk": ["test/*.doctest", "VERSION"]},
-    python_requires=">=3.6",
+    python_requires=">=3.7",
     install_requires=[
         "click",
         "joblib",

{"golden_diff": "diff --git a/nltk/__init__.py b/nltk/__init__.py\n--- a/nltk/__init__.py\n+++ b/nltk/__init__.py\n@@ -52,7 +52,7 @@\n # Description of the toolkit, keywords, and the project's primary URL.\n __longdescr__ = \"\"\"\\\n The Natural Language Toolkit (NLTK) is a Python package for\n-natural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9.\"\"\"\n+natural language processing.  NLTK requires Python 3.7, 3.8, 3.9 or 3.10.\"\"\"\n __keywords__ = [\n     \"NLP\",\n     \"CL\",\n@@ -84,10 +84,10 @@\n     \"Intended Audience :: Science/Research\",\n     \"License :: OSI Approved :: Apache Software License\",\n     \"Operating System :: OS Independent\",\n-    \"Programming Language :: Python :: 3.6\",\n     \"Programming Language :: Python :: 3.7\",\n     \"Programming Language :: Python :: 3.8\",\n     \"Programming Language :: Python :: 3.9\",\n+    \"Programming Language :: Python :: 3.10\",\n     \"Topic :: Scientific/Engineering\",\n     \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n     \"Topic :: Scientific/Engineering :: Human Machine Interfaces\",\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -67,7 +67,7 @@\n     },\n     long_description=\"\"\"\\\n The Natural Language Toolkit (NLTK) is a Python package for\n-natural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9.\"\"\",\n+natural language processing.  NLTK requires Python 3.7, 3.8, 3.9 or 3.10.\"\"\",\n     license=\"Apache License, Version 2.0\",\n     keywords=[\n         \"NLP\",\n@@ -95,10 +95,10 @@\n         \"Intended Audience :: Science/Research\",\n         \"License :: OSI Approved :: Apache Software License\",\n         \"Operating System :: OS Independent\",\n-        \"Programming Language :: Python :: 3.6\",\n         \"Programming Language :: Python :: 3.7\",\n         \"Programming Language :: Python :: 3.8\",\n         \"Programming Language :: Python :: 3.9\",\n+        \"Programming Language :: Python :: 3.10\",\n         \"Topic :: Scientific/Engineering\",\n         \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n         \"Topic :: Scientific/Engineering :: Human Machine Interfaces\",\n@@ -110,7 +110,7 @@\n         \"Topic :: Text Processing :: Linguistic\",\n     ],\n     package_data={\"nltk\": [\"test/*.doctest\", \"VERSION\"]},\n-    python_requires=\">=3.6\",\n+    python_requires=\">=3.7\",\n     install_requires=[\n         \"click\",\n         \"joblib\",\n", "issue": "Consider deprecating Python 3.6\nHello!\r\n\r\nPython 3.6 is approaching its End Of Life on December 23rd, and we should consider dropping support for Python 3.6 accordingly. In particular, this involves modifying:\r\n* CI tests\r\n* `python_requires` in `setup.py`.\r\n* Lots of documentation throughout the project.\r\n\r\nAmong other places, I'm sure.\r\n\r\n- Tom Aarsen\nAdd CI tests for Python 3.10\nHello!\r\n\r\nPython 3.10 is no longer a glimmer far into the future, and we should start supporting it. The first step in doing so is adding 3.10 to the CI tests, and mentioning that NLTK works for Python 3.10 in our documentation throughout the project.\r\n\r\n- Tom Aarsen\n", "before_files": [{"content": "#!/usr/bin/env python\n#\n# Setup script for the Natural Language Toolkit\n#\n# Copyright (C) 2001-2021 NLTK Project\n# Author: NLTK Team <nltk.team@gmail.com>\n# URL: <https://www.nltk.org/>\n# For license information, see LICENSE.TXT\n\n# Work around mbcs bug in distutils.\n# https://bugs.python.org/issue10945\nimport codecs\n\ntry:\n    codecs.lookup(\"mbcs\")\nexcept LookupError:\n    ascii = codecs.lookup(\"ascii\")\n    func = lambda name, enc=ascii: {True: enc}.get(name == \"mbcs\")\n    codecs.register(func)\n\nimport os\n\n# Use the VERSION file to get NLTK version\nversion_file = os.path.join(os.path.dirname(__file__), \"nltk\", \"VERSION\")\nwith open(version_file) as fh:\n    nltk_version = fh.read().strip()\n\n# setuptools\nfrom setuptools import find_packages, setup\n\n# Specify groups of optional dependencies\nextras_require = {\n    \"machine_learning\": [\n        \"numpy\",\n        \"python-crfsuite\",\n        \"scikit-learn\",\n        \"scipy\",\n    ],\n    \"plot\": [\"matplotlib\"],\n    \"tgrep\": [\"pyparsing\"],\n    \"twitter\": [\"twython\"],\n    \"corenlp\": [\"requests\"],\n}\n\n# Add a group made up of all optional dependencies\nextras_require[\"all\"] = {\n    package for group in extras_require.values() for package in group\n}\n\n# Adds CLI commands\nconsole_scripts = \"\"\"\n[console_scripts]\nnltk=nltk.cli:cli\n\"\"\"\n\n_project_homepage = \"https://www.nltk.org/\"\n\nsetup(\n    name=\"nltk\",\n    description=\"Natural Language Toolkit\",\n    version=nltk_version,\n    url=_project_homepage,\n    project_urls={\n        \"Documentation\": _project_homepage,\n        \"Source Code\": \"https://github.com/nltk/nltk\",\n        \"Issue Tracker\": \"https://github.com/nltk/nltk/issues\",\n    },\n    long_description=\"\"\"\\\nThe Natural Language Toolkit (NLTK) is a Python package for\nnatural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9.\"\"\",\n    license=\"Apache License, Version 2.0\",\n    keywords=[\n        \"NLP\",\n        \"CL\",\n        \"natural language processing\",\n        \"computational linguistics\",\n        \"parsing\",\n        \"tagging\",\n        \"tokenizing\",\n        \"syntax\",\n        \"linguistics\",\n        \"language\",\n        \"natural language\",\n        \"text analytics\",\n    ],\n    maintainer=\"NLTK Team\",\n    maintainer_email=\"nltk.team@gmail.com\",\n    author=\"NLTK Team\",\n    author_email=\"nltk.team@gmail.com\",\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Information Technology\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Topic :: Scientific/Engineering\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n        \"Topic :: Scientific/Engineering :: Human Machine Interfaces\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n        \"Topic :: Text Processing\",\n        \"Topic :: Text Processing :: Filters\",\n        \"Topic :: Text Processing :: General\",\n        \"Topic :: Text Processing :: Indexing\",\n        \"Topic :: Text Processing :: Linguistic\",\n    ],\n    package_data={\"nltk\": [\"test/*.doctest\", \"VERSION\"]},\n    python_requires=\">=3.6\",\n    install_requires=[\n        \"click\",\n        \"joblib\",\n        \"regex>=2021.8.3\",\n        \"tqdm\",\n    ],\n    extras_require=extras_require,\n    packages=find_packages(),\n    zip_safe=False,  # since normal files will be present too?\n    entry_points=console_scripts,\n)\n", "path": "setup.py"}, {"content": "# Natural Language Toolkit (NLTK)\n#\n# Copyright (C) 2001-2021 NLTK Project\n# Authors: Steven Bird <stevenbird1@gmail.com>\n#          Edward Loper <edloper@gmail.com>\n# URL: <https://www.nltk.org/>\n# For license information, see LICENSE.TXT\n\n\"\"\"\nThe Natural Language Toolkit (NLTK) is an open source Python library\nfor Natural Language Processing.  A free online book is available.\n(If you use the library for academic research, please cite the book.)\n\nSteven Bird, Ewan Klein, and Edward Loper (2009).\nNatural Language Processing with Python.  O'Reilly Media Inc.\nhttps://www.nltk.org/book/\n\nisort:skip_file\n\"\"\"\n\nimport os\n\n# //////////////////////////////////////////////////////\n# Metadata\n# //////////////////////////////////////////////////////\n\n# Version.  For each new release, the version number should be updated\n# in the file VERSION.\ntry:\n    # If a VERSION file exists, use it!\n    version_file = os.path.join(os.path.dirname(__file__), \"VERSION\")\n    with open(version_file) as infile:\n        __version__ = infile.read().strip()\nexcept NameError:\n    __version__ = \"unknown (running code interactively?)\"\nexcept OSError as ex:\n    __version__ = \"unknown (%s)\" % ex\n\nif __doc__ is not None:  # fix for the ``python -OO``\n    __doc__ += \"\\n@version: \" + __version__\n\n\n# Copyright notice\n__copyright__ = \"\"\"\\\nCopyright (C) 2001-2021 NLTK Project.\n\nDistributed and Licensed under the Apache License, Version 2.0,\nwhich is included by reference.\n\"\"\"\n\n__license__ = \"Apache License, Version 2.0\"\n# Description of the toolkit, keywords, and the project's primary URL.\n__longdescr__ = \"\"\"\\\nThe Natural Language Toolkit (NLTK) is a Python package for\nnatural language processing.  NLTK requires Python 3.6, 3.7, 3.8, or 3.9.\"\"\"\n__keywords__ = [\n    \"NLP\",\n    \"CL\",\n    \"natural language processing\",\n    \"computational linguistics\",\n    \"parsing\",\n    \"tagging\",\n    \"tokenizing\",\n    \"syntax\",\n    \"linguistics\",\n    \"language\",\n    \"natural language\",\n    \"text analytics\",\n]\n__url__ = \"https://www.nltk.org/\"\n\n# Maintainer, contributors, etc.\n__maintainer__ = \"NLTK Team\"\n__maintainer_email__ = \"nltk.team@gmail.com\"\n__author__ = __maintainer__\n__author_email__ = __maintainer_email__\n\n# \"Trove\" classifiers for Python Package Index.\n__classifiers__ = [\n    \"Development Status :: 5 - Production/Stable\",\n    \"Intended Audience :: Developers\",\n    \"Intended Audience :: Education\",\n    \"Intended Audience :: Information Technology\",\n    \"Intended Audience :: Science/Research\",\n    \"License :: OSI Approved :: Apache Software License\",\n    \"Operating System :: OS Independent\",\n    \"Programming Language :: Python :: 3.6\",\n    \"Programming Language :: Python :: 3.7\",\n    \"Programming Language :: Python :: 3.8\",\n    \"Programming Language :: Python :: 3.9\",\n    \"Topic :: Scientific/Engineering\",\n    \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n    \"Topic :: Scientific/Engineering :: Human Machine Interfaces\",\n    \"Topic :: Scientific/Engineering :: Information Analysis\",\n    \"Topic :: Text Processing\",\n    \"Topic :: Text Processing :: Filters\",\n    \"Topic :: Text Processing :: General\",\n    \"Topic :: Text Processing :: Indexing\",\n    \"Topic :: Text Processing :: Linguistic\",\n]\n\nfrom nltk.internals import config_java\n\n# support numpy from pypy\ntry:\n    import numpypy\nexcept ImportError:\n    pass\n\n# Override missing methods on environments where it cannot be used like GAE.\nimport subprocess\n\nif not hasattr(subprocess, \"PIPE\"):\n\n    def _fake_PIPE(*args, **kwargs):\n        raise NotImplementedError(\"subprocess.PIPE is not supported.\")\n\n    subprocess.PIPE = _fake_PIPE\nif not hasattr(subprocess, \"Popen\"):\n\n    def _fake_Popen(*args, **kwargs):\n        raise NotImplementedError(\"subprocess.Popen is not supported.\")\n\n    subprocess.Popen = _fake_Popen\n\n###########################################################\n# TOP-LEVEL MODULES\n###########################################################\n\n# Import top-level functionality into top-level namespace\n\nfrom nltk.collocations import *\nfrom nltk.decorators import decorator, memoize\nfrom nltk.featstruct import *\nfrom nltk.grammar import *\nfrom nltk.probability import *\nfrom nltk.text import *\nfrom nltk.util import *\nfrom nltk.jsontags import *\n\n###########################################################\n# PACKAGES\n###########################################################\n\nfrom nltk.chunk import *\nfrom nltk.classify import *\nfrom nltk.inference import *\nfrom nltk.metrics import *\nfrom nltk.parse import *\nfrom nltk.tag import *\nfrom nltk.tokenize import *\nfrom nltk.translate import *\nfrom nltk.tree import *\nfrom nltk.sem import *\nfrom nltk.stem import *\n\n# Packages which can be lazily imported\n# (a) we don't import *\n# (b) they're slow to import or have run-time dependencies\n#     that can safely fail at run time\n\nfrom nltk import lazyimport\n\napp = lazyimport.LazyModule(\"nltk.app\", locals(), globals())\nchat = lazyimport.LazyModule(\"nltk.chat\", locals(), globals())\ncorpus = lazyimport.LazyModule(\"nltk.corpus\", locals(), globals())\ndraw = lazyimport.LazyModule(\"nltk.draw\", locals(), globals())\ntoolbox = lazyimport.LazyModule(\"nltk.toolbox\", locals(), globals())\n\n# Optional loading\n\ntry:\n    import numpy\nexcept ImportError:\n    pass\nelse:\n    from nltk import cluster\n\nfrom nltk.downloader import download, download_shell\n\ntry:\n    import tkinter\nexcept ImportError:\n    pass\nelse:\n    try:\n        from nltk.downloader import download_gui\n    except RuntimeError as e:\n        import warnings\n\n        warnings.warn(\n            \"Corpus downloader GUI not loaded \"\n            \"(RuntimeError during import: %s)\" % str(e)\n        )\n\n# explicitly import all top-level modules (ensuring\n# they override the same names inadvertently imported\n# from a subpackage)\n\nfrom nltk import ccg, chunk, classify, collocations\nfrom nltk import data, featstruct, grammar, help, inference, metrics\nfrom nltk import misc, parse, probability, sem, stem, wsd\nfrom nltk import tag, tbl, text, tokenize, translate, tree, util\n\n\n# FIXME:  override any accidentally imported demo, see https://github.com/nltk/nltk/issues/2116\ndef demo():\n    print(\"To run the demo code for a module, type nltk.module.demo()\")\n", "path": "nltk/__init__.py"}], "after_files": [{"content": "#!/usr/bin/env python\n#\n# Setup script for the Natural Language Toolkit\n#\n# Copyright (C) 2001-2021 NLTK Project\n# Author: NLTK Team <nltk.team@gmail.com>\n# URL: <https://www.nltk.org/>\n# For license information, see LICENSE.TXT\n\n# Work around mbcs bug in distutils.\n# https://bugs.python.org/issue10945\nimport codecs\n\ntry:\n    codecs.lookup(\"mbcs\")\nexcept LookupError:\n    ascii = codecs.lookup(\"ascii\")\n    func = lambda name, enc=ascii: {True: enc}.get(name == \"mbcs\")\n    codecs.register(func)\n\nimport os\n\n# Use the VERSION file to get NLTK version\nversion_file = os.path.join(os.path.dirname(__file__), \"nltk\", \"VERSION\")\nwith open(version_file) as fh:\n    nltk_version = fh.read().strip()\n\n# setuptools\nfrom setuptools import find_packages, setup\n\n# Specify groups of optional dependencies\nextras_require = {\n    \"machine_learning\": [\n        \"numpy\",\n        \"python-crfsuite\",\n        \"scikit-learn\",\n        \"scipy\",\n    ],\n    \"plot\": [\"matplotlib\"],\n    \"tgrep\": [\"pyparsing\"],\n    \"twitter\": [\"twython\"],\n    \"corenlp\": [\"requests\"],\n}\n\n# Add a group made up of all optional dependencies\nextras_require[\"all\"] = {\n    package for group in extras_require.values() for package in group\n}\n\n# Adds CLI commands\nconsole_scripts = \"\"\"\n[console_scripts]\nnltk=nltk.cli:cli\n\"\"\"\n\n_project_homepage = \"https://www.nltk.org/\"\n\nsetup(\n    name=\"nltk\",\n    description=\"Natural Language Toolkit\",\n    version=nltk_version,\n    url=_project_homepage,\n    project_urls={\n        \"Documentation\": _project_homepage,\n        \"Source Code\": \"https://github.com/nltk/nltk\",\n        \"Issue Tracker\": \"https://github.com/nltk/nltk/issues\",\n    },\n    long_description=\"\"\"\\\nThe Natural Language Toolkit (NLTK) is a Python package for\nnatural language processing.  NLTK requires Python 3.7, 3.8, 3.9 or 3.10.\"\"\",\n    license=\"Apache License, Version 2.0\",\n    keywords=[\n        \"NLP\",\n        \"CL\",\n        \"natural language processing\",\n        \"computational linguistics\",\n        \"parsing\",\n        \"tagging\",\n        \"tokenizing\",\n        \"syntax\",\n        \"linguistics\",\n        \"language\",\n        \"natural language\",\n        \"text analytics\",\n    ],\n    maintainer=\"NLTK Team\",\n    maintainer_email=\"nltk.team@gmail.com\",\n    author=\"NLTK Team\",\n    author_email=\"nltk.team@gmail.com\",\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Information Technology\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Topic :: Scientific/Engineering\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n        \"Topic :: Scientific/Engineering :: Human Machine Interfaces\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n        \"Topic :: Text Processing\",\n        \"Topic :: Text Processing :: Filters\",\n        \"Topic :: Text Processing :: General\",\n        \"Topic :: Text Processing :: Indexing\",\n        \"Topic :: Text Processing :: Linguistic\",\n    ],\n    package_data={\"nltk\": [\"test/*.doctest\", \"VERSION\"]},\n    python_requires=\">=3.7\",\n    install_requires=[\n        \"click\",\n        \"joblib\",\n        \"regex>=2021.8.3\",\n        \"tqdm\",\n    ],\n    extras_require=extras_require,\n    packages=find_packages(),\n    zip_safe=False,  # since normal files will be present too?\n    entry_points=console_scripts,\n)\n", "path": "setup.py"}, {"content": "# Natural Language Toolkit (NLTK)\n#\n# Copyright (C) 2001-2021 NLTK Project\n# Authors: Steven Bird <stevenbird1@gmail.com>\n#          Edward Loper <edloper@gmail.com>\n# URL: <https://www.nltk.org/>\n# For license information, see LICENSE.TXT\n\n\"\"\"\nThe Natural Language Toolkit (NLTK) is an open source Python library\nfor Natural Language Processing.  A free online book is available.\n(If you use the library for academic research, please cite the book.)\n\nSteven Bird, Ewan Klein, and Edward Loper (2009).\nNatural Language Processing with Python.  O'Reilly Media Inc.\nhttps://www.nltk.org/book/\n\nisort:skip_file\n\"\"\"\n\nimport os\n\n# //////////////////////////////////////////////////////\n# Metadata\n# //////////////////////////////////////////////////////\n\n# Version.  For each new release, the version number should be updated\n# in the file VERSION.\ntry:\n    # If a VERSION file exists, use it!\n    version_file = os.path.join(os.path.dirname(__file__), \"VERSION\")\n    with open(version_file) as infile:\n        __version__ = infile.read().strip()\nexcept NameError:\n    __version__ = \"unknown (running code interactively?)\"\nexcept OSError as ex:\n    __version__ = \"unknown (%s)\" % ex\n\nif __doc__ is not None:  # fix for the ``python -OO``\n    __doc__ += \"\\n@version: \" + __version__\n\n\n# Copyright notice\n__copyright__ = \"\"\"\\\nCopyright (C) 2001-2021 NLTK Project.\n\nDistributed and Licensed under the Apache License, Version 2.0,\nwhich is included by reference.\n\"\"\"\n\n__license__ = \"Apache License, Version 2.0\"\n# Description of the toolkit, keywords, and the project's primary URL.\n__longdescr__ = \"\"\"\\\nThe Natural Language Toolkit (NLTK) is a Python package for\nnatural language processing.  NLTK requires Python 3.7, 3.8, 3.9 or 3.10.\"\"\"\n__keywords__ = [\n    \"NLP\",\n    \"CL\",\n    \"natural language processing\",\n    \"computational linguistics\",\n    \"parsing\",\n    \"tagging\",\n    \"tokenizing\",\n    \"syntax\",\n    \"linguistics\",\n    \"language\",\n    \"natural language\",\n    \"text analytics\",\n]\n__url__ = \"https://www.nltk.org/\"\n\n# Maintainer, contributors, etc.\n__maintainer__ = \"NLTK Team\"\n__maintainer_email__ = \"nltk.team@gmail.com\"\n__author__ = __maintainer__\n__author_email__ = __maintainer_email__\n\n# \"Trove\" classifiers for Python Package Index.\n__classifiers__ = [\n    \"Development Status :: 5 - Production/Stable\",\n    \"Intended Audience :: Developers\",\n    \"Intended Audience :: Education\",\n    \"Intended Audience :: Information Technology\",\n    \"Intended Audience :: Science/Research\",\n    \"License :: OSI Approved :: Apache Software License\",\n    \"Operating System :: OS Independent\",\n    \"Programming Language :: Python :: 3.7\",\n    \"Programming Language :: Python :: 3.8\",\n    \"Programming Language :: Python :: 3.9\",\n    \"Programming Language :: Python :: 3.10\",\n    \"Topic :: Scientific/Engineering\",\n    \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n    \"Topic :: Scientific/Engineering :: Human Machine Interfaces\",\n    \"Topic :: Scientific/Engineering :: Information Analysis\",\n    \"Topic :: Text Processing\",\n    \"Topic :: Text Processing :: Filters\",\n    \"Topic :: Text Processing :: General\",\n    \"Topic :: Text Processing :: Indexing\",\n    \"Topic :: Text Processing :: Linguistic\",\n]\n\nfrom nltk.internals import config_java\n\n# support numpy from pypy\ntry:\n    import numpypy\nexcept ImportError:\n    pass\n\n# Override missing methods on environments where it cannot be used like GAE.\nimport subprocess\n\nif not hasattr(subprocess, \"PIPE\"):\n\n    def _fake_PIPE(*args, **kwargs):\n        raise NotImplementedError(\"subprocess.PIPE is not supported.\")\n\n    subprocess.PIPE = _fake_PIPE\nif not hasattr(subprocess, \"Popen\"):\n\n    def _fake_Popen(*args, **kwargs):\n        raise NotImplementedError(\"subprocess.Popen is not supported.\")\n\n    subprocess.Popen = _fake_Popen\n\n###########################################################\n# TOP-LEVEL MODULES\n###########################################################\n\n# Import top-level functionality into top-level namespace\n\nfrom nltk.collocations import *\nfrom nltk.decorators import decorator, memoize\nfrom nltk.featstruct import *\nfrom nltk.grammar import *\nfrom nltk.probability import *\nfrom nltk.text import *\nfrom nltk.util import *\nfrom nltk.jsontags import *\n\n###########################################################\n# PACKAGES\n###########################################################\n\nfrom nltk.chunk import *\nfrom nltk.classify import *\nfrom nltk.inference import *\nfrom nltk.metrics import *\nfrom nltk.parse import *\nfrom nltk.tag import *\nfrom nltk.tokenize import *\nfrom nltk.translate import *\nfrom nltk.tree import *\nfrom nltk.sem import *\nfrom nltk.stem import *\n\n# Packages which can be lazily imported\n# (a) we don't import *\n# (b) they're slow to import or have run-time dependencies\n#     that can safely fail at run time\n\nfrom nltk import lazyimport\n\napp = lazyimport.LazyModule(\"nltk.app\", locals(), globals())\nchat = lazyimport.LazyModule(\"nltk.chat\", locals(), globals())\ncorpus = lazyimport.LazyModule(\"nltk.corpus\", locals(), globals())\ndraw = lazyimport.LazyModule(\"nltk.draw\", locals(), globals())\ntoolbox = lazyimport.LazyModule(\"nltk.toolbox\", locals(), globals())\n\n# Optional loading\n\ntry:\n    import numpy\nexcept ImportError:\n    pass\nelse:\n    from nltk import cluster\n\nfrom nltk.downloader import download, download_shell\n\ntry:\n    import tkinter\nexcept ImportError:\n    pass\nelse:\n    try:\n        from nltk.downloader import download_gui\n    except RuntimeError as e:\n        import warnings\n\n        warnings.warn(\n            \"Corpus downloader GUI not loaded \"\n            \"(RuntimeError during import: %s)\" % str(e)\n        )\n\n# explicitly import all top-level modules (ensuring\n# they override the same names inadvertently imported\n# from a subpackage)\n\nfrom nltk import ccg, chunk, classify, collocations\nfrom nltk import data, featstruct, grammar, help, inference, metrics\nfrom nltk import misc, parse, probability, sem, stem, wsd\nfrom nltk import tag, tbl, text, tokenize, translate, tree, util\n\n\n# FIXME:  override any accidentally imported demo, see https://github.com/nltk/nltk/issues/2116\ndef demo():\n    print(\"To run the demo code for a module, type nltk.module.demo()\")\n", "path": "nltk/__init__.py"}]}