prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Enable typing support
  ## 🚀 Feature
  
  Enable typing support for `kornia` so other packages can benefit from the type hints.
  
  ## Motivation
  
  Currently `kornia` only uses the type hints to check for internal consistency. For other packages you get the following error message when running `mypy`:
  
  ```python
  import kornia
  ```
  
  ```
  error: Cannot find implementation or library stub for module named 'kornia'  [import]
  ```
  
  ## Pitch
  
  To enable typing for other packages that depend on `kornia` we just need to put an empty file called `py.typed` in the root of the `kornia` package. See [`PEP561`](https://www.python.org/dev/peps/pep-0561/#packaging-type-information) for details.
  
  
  
  --- 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 # Welcome to the Kornia setup.py.
  2 #
  3 
  4 import os
  5 from setuptools import setup, find_packages
  6 import subprocess
  7 import distutils.command.clean
  8 
  9 
  10 ################
  11 # The variables below define the current version under
  12 # development and the current pytorch supported verions.
  13 # WARNING: Becareful and do not touch those variables,
  14 # unless you are a maintainer. Otherwise, could brake
  15 # the package backward compatibility.
  16 
  17 # NOTE(maintainers): modify this variable each time you do a release
  18 
  19 version = '0.4.1'  # this a tag for the current development version
  20 
  21 
  22 # NOTE(maintainers): update this dictionary each time you do a release
  23 # When multiple pytorch versions are associated with a single version of kornia,
  24 # the oldest one is the requirement. The versions should be inequalities.
  25 # Once a pytorch version (in the future) breaks a kornia version, we could just
  26 # add a maximal version.
  27 kornia_pt_dependencies = {
  28     '0.4.0': '>=1.6.0,<1.7.0',
  29     '0.3.2': '>=1.5.0,<1.6.0',
  30     '0.3.1': '>=1.5.0',
  31     '0.2.2': '>=1.4.0',
  32     '0.1.4': '>=1.2.0',
  33 }
  34 
  35 
  36 # version can be overiden eg with KORNIA_BUILD_VERSION so we map each possible kornia version to the dictionary keys
  37 def dep_version(version):
  38     compatible_versions = [v for v in kornia_pt_dependencies.keys() if v >= version]
  39     compatible_versions += [sorted(kornia_pt_dependencies)[-1]]
  40     return min(compatible_versions)
  41 
  42 
  43 #################################
  44 
  45 sha = 'Unknown'
  46 package_name = 'kornia'
  47 
  48 cwd = os.path.dirname(os.path.abspath(__file__))
  49 
  50 try:
  51     sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
  52 except Exception:
  53     pass
  54 
  55 if os.getenv('KORNIA_BUILD_VERSION'):
  56     version = os.getenv('KORNIA_BUILD_VERSION')
  57 elif sha != 'Unknown':
  58     version += '+' + sha[:7]
  59 print("Building wheel {}-{}".format(package_name, version))
  60 
  61 
  62 def write_version_file():
  63     version_path = os.path.join(cwd, 'kornia', 'version.py')
  64     with open(version_path, 'w') as f:
  65         f.write("__version__ = '{}'\n".format(version))
  66         f.write("git_version = {}\n".format(repr(sha)))
  67 
  68 
  69 def read(*names, **kwargs):
  70     with io.open(
  71         os.path.join(os.path.dirname(__file__), *names),
  72         encoding=kwargs.get("encoding", "utf8")
  73     ) as fp:
  74         return fp.read()
  75 
  76 
  77 # open readme file and remove logo
  78 readme = open('README.rst').read()
  79 long_description = '\n'.join(readme.split('\n')[7:])
  80 
  81 
  82 class clean(distutils.command.clean.clean):
  83     def run(self):
  84         with open('.gitignore', 'r') as f:
  85             ignores = f.read()
  86             for wildcard in filter(None, ignores.split('\n')):
  87                 for filename in glob.glob(wildcard):
  88                     try:
  89                         os.remove(filename)
  90                     except OSError:
  91                         shutil.rmtree(filename, ignore_errors=True)
  92 
  93         # It's an old-style class in Python 2.7...
  94         distutils.command.clean.clean.run(self)
  95     # remove compiled and temporary files
  96     subprocess.call(['rm -rf dist/ build/ kornia.egg*'], shell=True)
  97 
  98 requirements = [
  99     'numpy',
  100     'torch' + kornia_pt_dependencies[dep_version(version)],
  101 ]
  102 
  103 
  104 if __name__ == '__main__':
  105     write_version_file()
  106     setup(
  107         # Metadata
  108         name=package_name,
  109         version=version,
  110         author='Edgar Riba',
  111         author_email='contact@kornia.org',
  112         url='https://github.com/kornia/kornia',
  113         description='Open Source Differentiable Computer Vision Library for PyTorch',
  114         long_description=long_description,
  115         license='Apache License 2.0',
  116         python_requires='>=3.6',
  117 
  118         # Test
  119         setup_requires=['pytest-runner'],
  120         tests_require=['pytest'],
  121 
  122         # Package info
  123         packages=find_packages(exclude=('docs', 'test', 'examples',)),
  124 
  125         zip_safe=True,
  126         install_requires=requirements,
  127         classifiers=[
  128             'Intended Audience :: Developers',
  129             'Intended Audience :: Education',
  130             'Intended Audience :: Science/Research',
  131             'Operating System :: POSIX :: Linux',
  132             'Programming Language :: Python :: 3 :: Only',
  133             'License :: OSI Approved :: Apache Software License',
  134             'Topic :: Scientific/Engineering :: Image Recognition',
  135             'Topic :: Software Development :: Libraries',
  136         ],
  137     )
  138
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -122,6 +122,10 @@
           # Package info
           packages=find_packages(exclude=('docs', 'test', 'examples',)),
   
  +        package_data={
  +            "kornia": ["py.typed"],
  +        },
  +
           zip_safe=True,
           install_requires=requirements,
           classifiers=[
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -122,6 +122,10 @@\n         # Package info\n         packages=find_packages(exclude=('docs', 'test', 'examples',)),\n \n+        package_data={\n+            \"kornia\": [\"py.typed\"],\n+        },\n+\n         zip_safe=True,\n         install_requires=requirements,\n         classifiers=[\n", "issue": "Enable typing support\n## \ud83d\ude80 Feature\r\n\r\nEnable typing support for `kornia` so other packages can benefit from the type hints.\r\n\r\n## Motivation\r\n\r\nCurrently `kornia` only uses the type hints to check for internal consistency. For other packages you get the following error message when running `mypy`:\r\n\r\n```python\r\nimport kornia\r\n```\r\n\r\n```\r\nerror: Cannot find implementation or library stub for module named 'kornia'  [import]\r\n```\r\n\r\n## Pitch\r\n\r\nTo enable typing for other packages that depend on `kornia` we just need to put an empty file called `py.typed` in the root of the `kornia` package. See [`PEP561`](https://www.python.org/dev/peps/pep-0561/#packaging-type-information) for details.\r\n\r\n\n", "before_files": [{"content": "# Welcome to the Kornia setup.py.\n#\n\nimport os\nfrom setuptools import setup, find_packages\nimport subprocess\nimport distutils.command.clean\n\n\n################\n# The variables below define the current version under\n# development and the current pytorch supported verions.\n# WARNING: Becareful and do not touch those variables,\n# unless you are a maintainer. Otherwise, could brake\n# the package backward compatibility.\n\n# NOTE(maintainers): modify this variable each time you do a release\n\nversion = '0.4.1'  # this a tag for the current development version\n\n\n# NOTE(maintainers): update this dictionary each time you do a release\n# When multiple pytorch versions are associated with a single version of kornia,\n# the oldest one is the requirement. The versions should be inequalities.\n# Once a pytorch version (in the future) breaks a kornia version, we could just\n# add a maximal version.\nkornia_pt_dependencies = {\n    '0.4.0': '>=1.6.0,<1.7.0',\n    '0.3.2': '>=1.5.0,<1.6.0',\n    '0.3.1': '>=1.5.0',\n    '0.2.2': '>=1.4.0',\n    '0.1.4': '>=1.2.0',\n}\n\n\n# version can be overiden eg with KORNIA_BUILD_VERSION so we map each possible kornia version to the dictionary keys\ndef dep_version(version):\n    compatible_versions = [v for v in kornia_pt_dependencies.keys() if v >= version]\n    compatible_versions += [sorted(kornia_pt_dependencies)[-1]]\n    return min(compatible_versions)\n\n\n#################################\n\nsha = 'Unknown'\npackage_name = 'kornia'\n\ncwd = os.path.dirname(os.path.abspath(__file__))\n\ntry:\n    sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()\nexcept Exception:\n    pass\n\nif os.getenv('KORNIA_BUILD_VERSION'):\n    version = os.getenv('KORNIA_BUILD_VERSION')\nelif sha != 'Unknown':\n    version += '+' + sha[:7]\nprint(\"Building wheel {}-{}\".format(package_name, version))\n\n\ndef write_version_file():\n    version_path = os.path.join(cwd, 'kornia', 'version.py')\n    with open(version_path, 'w') as f:\n        f.write(\"__version__ = '{}'\\n\".format(version))\n        f.write(\"git_version = {}\\n\".format(repr(sha)))\n\n\ndef read(*names, **kwargs):\n    with io.open(\n        os.path.join(os.path.dirname(__file__), *names),\n        encoding=kwargs.get(\"encoding\", \"utf8\")\n    ) as fp:\n        return fp.read()\n\n\n# open readme file and remove logo\nreadme = open('README.rst').read()\nlong_description = '\\n'.join(readme.split('\\n')[7:])\n\n\nclass clean(distutils.command.clean.clean):\n    def run(self):\n        with open('.gitignore', 'r') as f:\n            ignores = f.read()\n            for wildcard in filter(None, ignores.split('\\n')):\n                for filename in glob.glob(wildcard):\n                    try:\n                        os.remove(filename)\n                    except OSError:\n                        shutil.rmtree(filename, ignore_errors=True)\n\n        # It's an old-style class in Python 2.7...\n        distutils.command.clean.clean.run(self)\n    # remove compiled and temporary files\n    subprocess.call(['rm -rf dist/ build/ kornia.egg*'], shell=True)\n\nrequirements = [\n    'numpy',\n    'torch' + kornia_pt_dependencies[dep_version(version)],\n]\n\n\nif __name__ == '__main__':\n    write_version_file()\n    setup(\n        # Metadata\n        name=package_name,\n        version=version,\n        author='Edgar Riba',\n        author_email='contact@kornia.org',\n        url='https://github.com/kornia/kornia',\n        description='Open Source Differentiable Computer Vision Library for PyTorch',\n        long_description=long_description,\n        license='Apache License 2.0',\n        python_requires='>=3.6',\n\n        # Test\n        setup_requires=['pytest-runner'],\n        tests_require=['pytest'],\n\n        # Package info\n        packages=find_packages(exclude=('docs', 'test', 'examples',)),\n\n        zip_safe=True,\n        install_requires=requirements,\n        classifiers=[\n            'Intended Audience :: Developers',\n            'Intended Audience :: Education',\n            'Intended Audience :: Science/Research',\n            'Operating System :: POSIX :: Linux',\n            'Programming Language :: Python :: 3 :: Only',\n            'License :: OSI Approved :: Apache Software License',\n            'Topic :: Scientific/Engineering :: Image Recognition',\n            'Topic :: Software Development :: Libraries',\n        ],\n    )\n", "path": "setup.py"}], "after_files": [{"content": "# Welcome to the Kornia setup.py.\n#\n\nimport os\nfrom setuptools import setup, find_packages\nimport subprocess\nimport distutils.command.clean\n\n\n################\n# The variables below define the current version under\n# development and the current pytorch supported verions.\n# WARNING: Becareful and do not touch those variables,\n# unless you are a maintainer. Otherwise, could brake\n# the package backward compatibility.\n\n# NOTE(maintainers): modify this variable each time you do a release\n\nversion = '0.4.1'  # this a tag for the current development version\n\n\n# NOTE(maintainers): update this dictionary each time you do a release\n# When multiple pytorch versions are associated with a single version of kornia,\n# the oldest one is the requirement. The versions should be inequalities.\n# Once a pytorch version (in the future) breaks a kornia version, we could just\n# add a maximal version.\nkornia_pt_dependencies = {\n    '0.4.0': '>=1.6.0,<1.7.0',\n    '0.3.2': '>=1.5.0,<1.6.0',\n    '0.3.1': '>=1.5.0',\n    '0.2.2': '>=1.4.0',\n    '0.1.4': '>=1.2.0',\n}\n\n\n# version can be overiden eg with KORNIA_BUILD_VERSION so we map each possible kornia version to the dictionary keys\ndef dep_version(version):\n    compatible_versions = [v for v in kornia_pt_dependencies.keys() if v >= version]\n    compatible_versions += [sorted(kornia_pt_dependencies)[-1]]\n    return min(compatible_versions)\n\n\n#################################\n\nsha = 'Unknown'\npackage_name = 'kornia'\n\ncwd = os.path.dirname(os.path.abspath(__file__))\n\ntry:\n    sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()\nexcept Exception:\n    pass\n\nif os.getenv('KORNIA_BUILD_VERSION'):\n    version = os.getenv('KORNIA_BUILD_VERSION')\nelif sha != 'Unknown':\n    version += '+' + sha[:7]\nprint(\"Building wheel {}-{}\".format(package_name, version))\n\n\ndef write_version_file():\n    version_path = os.path.join(cwd, 'kornia', 'version.py')\n    with open(version_path, 'w') as f:\n        f.write(\"__version__ = '{}'\\n\".format(version))\n        f.write(\"git_version = {}\\n\".format(repr(sha)))\n\n\ndef read(*names, **kwargs):\n    with io.open(\n        os.path.join(os.path.dirname(__file__), *names),\n        encoding=kwargs.get(\"encoding\", \"utf8\")\n    ) as fp:\n        return fp.read()\n\n\n# open readme file and remove logo\nreadme = open('README.rst').read()\nlong_description = '\\n'.join(readme.split('\\n')[7:])\n\n\nclass clean(distutils.command.clean.clean):\n    def run(self):\n        with open('.gitignore', 'r') as f:\n            ignores = f.read()\n            for wildcard in filter(None, ignores.split('\\n')):\n                for filename in glob.glob(wildcard):\n                    try:\n                        os.remove(filename)\n                    except OSError:\n                        shutil.rmtree(filename, ignore_errors=True)\n\n        # It's an old-style class in Python 2.7...\n        distutils.command.clean.clean.run(self)\n    # remove compiled and temporary files\n    subprocess.call(['rm -rf dist/ build/ kornia.egg*'], shell=True)\n\nrequirements = [\n    'numpy',\n    'torch' + kornia_pt_dependencies[dep_version(version)],\n]\n\n\nif __name__ == '__main__':\n    write_version_file()\n    setup(\n        # Metadata\n        name=package_name,\n        version=version,\n        author='Edgar Riba',\n        author_email='contact@kornia.org',\n        url='https://github.com/kornia/kornia',\n        description='Open Source Differentiable Computer Vision Library for PyTorch',\n        long_description=long_description,\n        license='Apache License 2.0',\n        python_requires='>=3.6',\n\n        # Test\n        setup_requires=['pytest-runner'],\n        tests_require=['pytest'],\n\n        # Package info\n        packages=find_packages(exclude=('docs', 'test', 'examples',)),\n\n        package_data={\n            \"kornia\": [\"py.typed\"],\n        },\n\n        zip_safe=True,\n        install_requires=requirements,\n        classifiers=[\n            'Intended Audience :: Developers',\n            'Intended Audience :: Education',\n            'Intended Audience :: Science/Research',\n            'Operating System :: POSIX :: Linux',\n            'Programming Language :: Python :: 3 :: Only',\n            'License :: OSI Approved :: Apache Software License',\n            'Topic :: Scientific/Engineering :: Image Recognition',\n            'Topic :: Software Development :: Libraries',\n        ],\n    )\n", "path": "setup.py"}]}