We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Deprecate Python 3.6 support
## 🚀 Feature

Deprecate python 3.6 -- support Python >= 3.7

______________________________________________________________________

#### Consider also to contribute to Kornia universe projects :)

<sub>

- [**Tutorials**](https://github.com/kornia/tutorials): our repository containing the tutorials.

</sub>


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `kornia/x/utils.py`
Content:
```
1 # TODO: remove the type: ignore in below after deprecating python 3.6
2 from dataclasses import dataclass, field  # type: ignore
3 from enum import Enum
4 from typing import Dict
5 
6 import torch.nn as nn
7 
8 from kornia.metrics.average_meter import AverageMeter
9 
10 # import yaml  # type: ignore
11 
12 
13 class TrainerState(Enum):
14     STARTING = 0
15     TRAINING = 1
16     VALIDATE = 2
17     TERMINATE = 3
18 
19 
20 # NOTE: this class needs to be redefined according to the needed parameters.
21 @dataclass
22 class Configuration:
23     data_path: str = field(default="./", metadata={"help": "The input data directory."})
24     batch_size: int = field(default=1, metadata={"help": "The number of batches for the training dataloader."})
25     num_epochs: int = field(default=1, metadata={"help": "The number of epochs to run the training."})
26     lr: float = field(default=1e-3, metadata={"help": "The learning rate to be used for the optimize."})
27     output_path: str = field(default="./output", metadata={"help": "The output data directory."})
28     image_size: tuple = field(default=(224, 224), metadata={"help": "The input image size."})
29 
30     # TODO: possibly remove because hydra already do this
31     # def __init__(self, **entries):
32     #     for k, v in entries.items():
33     #         self.__dict__[k] = Configuration(**v) if isinstance(v, dict) else v
34 
35     # @classmethod
36     # def from_yaml(cls, config_file: str):
37     #     """Create an instance of the configuration from a yaml file."""
38     #     with open(config_file) as f:
39     #         data = yaml.safe_load(f)
40     #     return cls(**data)
41 
42 
43 class Lambda(nn.Module):
44     """Module to create a lambda function as nn.Module.
45 
46     Args:
47         fcn: a pointer to any function.
48 
49     Example:
50         >>> import torch
51         >>> import kornia as K
52         >>> fcn = Lambda(lambda x: K.geometry.resize(x, (32, 16)))
53         >>> fcn(torch.rand(1, 4, 64, 32)).shape
54         torch.Size([1, 4, 32, 16])
55     """
56 
57     def __init__(self, fcn):
58         super().__init__()
59         self.fcn = fcn
60 
61     def forward(self, x):
62         return self.fcn(x)
63 
64 
65 class StatsTracker:
66     """Stats tracker for computing metrics on the fly."""
67 
68     def __init__(self) -> None:
69         self._stats: Dict[str, AverageMeter] = {}
70 
71     @property
72     def stats(self):
73         return self._stats
74 
75     def update(self, key: str, val: float, batch_size: int) -> None:
76         """Update the stats by the key value pair."""
77         if key not in self._stats:
78             self._stats[key] = AverageMeter()
79         self._stats[key].update(val, batch_size)
80 
81     def update_from_dict(self, dic: Dict[str, float], batch_size: int) -> None:
82         """Update the stats by the dict."""
83         for k, v in dic.items():
84             self.update(k, v, batch_size)
85 
86     def __repr__(self) -> str:
87         return " ".join([f"{k.upper()}: {v.val:.2f} {v.val:.2f} " for k, v in self._stats.items()])
88 
89     def as_dict(self) -> Dict[str, AverageMeter]:
90         """Return the dict format."""
91         return self._stats
92
```

Path: `setup.py`
Content:
```
1 # Welcome to the Kornia setup.py.
2 import sys
3 
4 # Make sure that kornia is running on Python 3.6.0 or later
5 # (to avoid running into this bug: https://bugs.python.org/issue29246)
6 
7 if sys.version_info < (3, 6, 0):
8     raise RuntimeError("Kornia requires Python 3.6.0 or later.")
9 
10 
11 from setuptools import setup
12 
13 setup()
14
```

Path: `kornia/utils/_compat.py`
Content:
```
1 from typing import TYPE_CHECKING, List, Optional, Tuple
2 
3 import torch
4 from torch import Tensor
5 
6 from packaging import version
7 
8 
9 def torch_version() -> str:
10     """Parse the `torch.__version__` variable and removes +cu*/cpu."""
11     return torch.__version__.split('+')[0]
12 
13 
14 # TODO: replace by torch_version_ge``
15 def torch_version_geq(major, minor) -> bool:
16     _version = version.parse(torch_version())
17     return _version >= version.parse(f"{major}.{minor}")
18 
19 
20 def torch_version_lt(major: int, minor: int, patch: int) -> bool:
21     _version = version.parse(torch_version())
22     return _version < version.parse(f"{major}.{minor}.{patch}")
23 
24 
25 def torch_version_le(major: int, minor: int, patch: int) -> bool:
26     _version = version.parse(torch_version())
27     return _version <= version.parse(f"{major}.{minor}.{patch}")
28 
29 
30 def torch_version_ge(major: int, minor: int, patch: int) -> bool:
31     _version = version.parse(torch_version())
32     return _version >= version.parse(f"{major}.{minor}.{patch}")
33 
34 
35 if version.parse(torch_version()) > version.parse("1.7.1"):
36     # TODO: remove the type: ignore once Python 3.6 is deprecated.
37     # It turns out that Pytorch has no attribute `torch.linalg` for
38     # Python 3.6 / PyTorch 1.7.0, 1.7.1
39     from torch.linalg import qr as linalg_qr  # type: ignore
40 else:
41     from torch import qr as linalg_qr  # type: ignore # noqa: F401
42 
43 
44 if torch_version_ge(1, 10, 0):
45 
46     if not TYPE_CHECKING:
47 
48         def torch_meshgrid(tensors: List[Tensor], indexing: str):
49             return torch.meshgrid(tensors, indexing=indexing)
50 
51 else:
52 
53     if TYPE_CHECKING:
54 
55         def torch_meshgrid(tensors: List[Tensor], indexing: Optional[str] = None) -> Tuple[Tensor, ...]:
56             return torch.meshgrid(tensors)
57 
58     else:
59 
60         def torch_meshgrid(tensors: List[Tensor], indexing: str):
61             return torch.meshgrid(tensors)
62 
63 
64 if torch_version_ge(1, 10, 0):
65     torch_inference_mode = torch.inference_mode
66 else:
67     torch_inference_mode = torch.no_grad
68
```
--- 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/kornia/utils/_compat.py b/kornia/utils/_compat.py
--- a/kornia/utils/_compat.py
+++ b/kornia/utils/_compat.py
@@ -33,12 +33,9 @@
 
 
 if version.parse(torch_version()) > version.parse("1.7.1"):
-    # TODO: remove the type: ignore once Python 3.6 is deprecated.
-    # It turns out that Pytorch has no attribute `torch.linalg` for
-    # Python 3.6 / PyTorch 1.7.0, 1.7.1
-    from torch.linalg import qr as linalg_qr  # type: ignore
+    from torch.linalg import qr as linalg_qr
 else:
-    from torch import qr as linalg_qr  # type: ignore # noqa: F401
+    from torch import qr as linalg_qr  # noqa: F401
 
 
 if torch_version_ge(1, 10, 0):
diff --git a/kornia/x/utils.py b/kornia/x/utils.py
--- a/kornia/x/utils.py
+++ b/kornia/x/utils.py
@@ -1,5 +1,4 @@
-# TODO: remove the type: ignore in below after deprecating python 3.6
-from dataclasses import dataclass, field  # type: ignore
+from dataclasses import dataclass, field
 from enum import Enum
 from typing import Dict
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,11 @@
 # Welcome to the Kornia setup.py.
 import sys
 
-# Make sure that kornia is running on Python 3.6.0 or later
+# Make sure that kornia is running on Python 3.7.0 or later
 # (to avoid running into this bug: https://bugs.python.org/issue29246)
 
-if sys.version_info < (3, 6, 0):
-    raise RuntimeError("Kornia requires Python 3.6.0 or later.")
+if sys.version_info < (3, 7, 0):
+    raise RuntimeError("Kornia requires Python 3.7.0 or later.")
 
 
 from setuptools import setup

{"golden_diff": "diff --git a/kornia/utils/_compat.py b/kornia/utils/_compat.py\n--- a/kornia/utils/_compat.py\n+++ b/kornia/utils/_compat.py\n@@ -33,12 +33,9 @@\n \n \n if version.parse(torch_version()) > version.parse(\"1.7.1\"):\n-    # TODO: remove the type: ignore once Python 3.6 is deprecated.\n-    # It turns out that Pytorch has no attribute `torch.linalg` for\n-    # Python 3.6 / PyTorch 1.7.0, 1.7.1\n-    from torch.linalg import qr as linalg_qr  # type: ignore\n+    from torch.linalg import qr as linalg_qr\n else:\n-    from torch import qr as linalg_qr  # type: ignore # noqa: F401\n+    from torch import qr as linalg_qr  # noqa: F401\n \n \n if torch_version_ge(1, 10, 0):\ndiff --git a/kornia/x/utils.py b/kornia/x/utils.py\n--- a/kornia/x/utils.py\n+++ b/kornia/x/utils.py\n@@ -1,5 +1,4 @@\n-# TODO: remove the type: ignore in below after deprecating python 3.6\n-from dataclasses import dataclass, field  # type: ignore\n+from dataclasses import dataclass, field\n from enum import Enum\n from typing import Dict\n \ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,11 +1,11 @@\n # Welcome to the Kornia setup.py.\n import sys\n \n-# Make sure that kornia is running on Python 3.6.0 or later\n+# Make sure that kornia is running on Python 3.7.0 or later\n # (to avoid running into this bug: https://bugs.python.org/issue29246)\n \n-if sys.version_info < (3, 6, 0):\n-    raise RuntimeError(\"Kornia requires Python 3.6.0 or later.\")\n+if sys.version_info < (3, 7, 0):\n+    raise RuntimeError(\"Kornia requires Python 3.7.0 or later.\")\n \n \n from setuptools import setup\n", "issue": "Deprecate Python 3.6 support\n## \ud83d\ude80 Feature\r\n\r\nDeprecate python 3.6 -- support Python >= 3.7\r\n\r\n______________________________________________________________________\r\n\r\n#### Consider also to contribute to Kornia universe projects :)\r\n\r\n<sub>\r\n\r\n- [**Tutorials**](https://github.com/kornia/tutorials): our repository containing the tutorials.\r\n\r\n</sub>\r\n\n", "before_files": [{"content": "# TODO: remove the type: ignore in below after deprecating python 3.6\nfrom dataclasses import dataclass, field  # type: ignore\nfrom enum import Enum\nfrom typing import Dict\n\nimport torch.nn as nn\n\nfrom kornia.metrics.average_meter import AverageMeter\n\n# import yaml  # type: ignore\n\n\nclass TrainerState(Enum):\n    STARTING = 0\n    TRAINING = 1\n    VALIDATE = 2\n    TERMINATE = 3\n\n\n# NOTE: this class needs to be redefined according to the needed parameters.\n@dataclass\nclass Configuration:\n    data_path: str = field(default=\"./\", metadata={\"help\": \"The input data directory.\"})\n    batch_size: int = field(default=1, metadata={\"help\": \"The number of batches for the training dataloader.\"})\n    num_epochs: int = field(default=1, metadata={\"help\": \"The number of epochs to run the training.\"})\n    lr: float = field(default=1e-3, metadata={\"help\": \"The learning rate to be used for the optimize.\"})\n    output_path: str = field(default=\"./output\", metadata={\"help\": \"The output data directory.\"})\n    image_size: tuple = field(default=(224, 224), metadata={\"help\": \"The input image size.\"})\n\n    # TODO: possibly remove because hydra already do this\n    # def __init__(self, **entries):\n    #     for k, v in entries.items():\n    #         self.__dict__[k] = Configuration(**v) if isinstance(v, dict) else v\n\n    # @classmethod\n    # def from_yaml(cls, config_file: str):\n    #     \"\"\"Create an instance of the configuration from a yaml file.\"\"\"\n    #     with open(config_file) as f:\n    #         data = yaml.safe_load(f)\n    #     return cls(**data)\n\n\nclass Lambda(nn.Module):\n    \"\"\"Module to create a lambda function as nn.Module.\n\n    Args:\n        fcn: a pointer to any function.\n\n    Example:\n        >>> import torch\n        >>> import kornia as K\n        >>> fcn = Lambda(lambda x: K.geometry.resize(x, (32, 16)))\n        >>> fcn(torch.rand(1, 4, 64, 32)).shape\n        torch.Size([1, 4, 32, 16])\n    \"\"\"\n\n    def __init__(self, fcn):\n        super().__init__()\n        self.fcn = fcn\n\n    def forward(self, x):\n        return self.fcn(x)\n\n\nclass StatsTracker:\n    \"\"\"Stats tracker for computing metrics on the fly.\"\"\"\n\n    def __init__(self) -> None:\n        self._stats: Dict[str, AverageMeter] = {}\n\n    @property\n    def stats(self):\n        return self._stats\n\n    def update(self, key: str, val: float, batch_size: int) -> None:\n        \"\"\"Update the stats by the key value pair.\"\"\"\n        if key not in self._stats:\n            self._stats[key] = AverageMeter()\n        self._stats[key].update(val, batch_size)\n\n    def update_from_dict(self, dic: Dict[str, float], batch_size: int) -> None:\n        \"\"\"Update the stats by the dict.\"\"\"\n        for k, v in dic.items():\n            self.update(k, v, batch_size)\n\n    def __repr__(self) -> str:\n        return \" \".join([f\"{k.upper()}: {v.val:.2f} {v.val:.2f} \" for k, v in self._stats.items()])\n\n    def as_dict(self) -> Dict[str, AverageMeter]:\n        \"\"\"Return the dict format.\"\"\"\n        return self._stats\n", "path": "kornia/x/utils.py"}, {"content": "# Welcome to the Kornia setup.py.\nimport sys\n\n# Make sure that kornia is running on Python 3.6.0 or later\n# (to avoid running into this bug: https://bugs.python.org/issue29246)\n\nif sys.version_info < (3, 6, 0):\n    raise RuntimeError(\"Kornia requires Python 3.6.0 or later.\")\n\n\nfrom setuptools import setup\n\nsetup()\n", "path": "setup.py"}, {"content": "from typing import TYPE_CHECKING, List, Optional, Tuple\n\nimport torch\nfrom torch import Tensor\n\nfrom packaging import version\n\n\ndef torch_version() -> str:\n    \"\"\"Parse the `torch.__version__` variable and removes +cu*/cpu.\"\"\"\n    return torch.__version__.split('+')[0]\n\n\n# TODO: replace by torch_version_ge``\ndef torch_version_geq(major, minor) -> bool:\n    _version = version.parse(torch_version())\n    return _version >= version.parse(f\"{major}.{minor}\")\n\n\ndef torch_version_lt(major: int, minor: int, patch: int) -> bool:\n    _version = version.parse(torch_version())\n    return _version < version.parse(f\"{major}.{minor}.{patch}\")\n\n\ndef torch_version_le(major: int, minor: int, patch: int) -> bool:\n    _version = version.parse(torch_version())\n    return _version <= version.parse(f\"{major}.{minor}.{patch}\")\n\n\ndef torch_version_ge(major: int, minor: int, patch: int) -> bool:\n    _version = version.parse(torch_version())\n    return _version >= version.parse(f\"{major}.{minor}.{patch}\")\n\n\nif version.parse(torch_version()) > version.parse(\"1.7.1\"):\n    # TODO: remove the type: ignore once Python 3.6 is deprecated.\n    # It turns out that Pytorch has no attribute `torch.linalg` for\n    # Python 3.6 / PyTorch 1.7.0, 1.7.1\n    from torch.linalg import qr as linalg_qr  # type: ignore\nelse:\n    from torch import qr as linalg_qr  # type: ignore # noqa: F401\n\n\nif torch_version_ge(1, 10, 0):\n\n    if not TYPE_CHECKING:\n\n        def torch_meshgrid(tensors: List[Tensor], indexing: str):\n            return torch.meshgrid(tensors, indexing=indexing)\n\nelse:\n\n    if TYPE_CHECKING:\n\n        def torch_meshgrid(tensors: List[Tensor], indexing: Optional[str] = None) -> Tuple[Tensor, ...]:\n            return torch.meshgrid(tensors)\n\n    else:\n\n        def torch_meshgrid(tensors: List[Tensor], indexing: str):\n            return torch.meshgrid(tensors)\n\n\nif torch_version_ge(1, 10, 0):\n    torch_inference_mode = torch.inference_mode\nelse:\n    torch_inference_mode = torch.no_grad\n", "path": "kornia/utils/_compat.py"}], "after_files": [{"content": "from dataclasses import dataclass, field\nfrom enum import Enum\nfrom typing import Dict\n\nimport torch.nn as nn\n\nfrom kornia.metrics.average_meter import AverageMeter\n\n# import yaml  # type: ignore\n\n\nclass TrainerState(Enum):\n    STARTING = 0\n    TRAINING = 1\n    VALIDATE = 2\n    TERMINATE = 3\n\n\n# NOTE: this class needs to be redefined according to the needed parameters.\n@dataclass\nclass Configuration:\n    data_path: str = field(default=\"./\", metadata={\"help\": \"The input data directory.\"})\n    batch_size: int = field(default=1, metadata={\"help\": \"The number of batches for the training dataloader.\"})\n    num_epochs: int = field(default=1, metadata={\"help\": \"The number of epochs to run the training.\"})\n    lr: float = field(default=1e-3, metadata={\"help\": \"The learning rate to be used for the optimize.\"})\n    output_path: str = field(default=\"./output\", metadata={\"help\": \"The output data directory.\"})\n    image_size: tuple = field(default=(224, 224), metadata={\"help\": \"The input image size.\"})\n\n    # TODO: possibly remove because hydra already do this\n    # def __init__(self, **entries):\n    #     for k, v in entries.items():\n    #         self.__dict__[k] = Configuration(**v) if isinstance(v, dict) else v\n\n    # @classmethod\n    # def from_yaml(cls, config_file: str):\n    #     \"\"\"Create an instance of the configuration from a yaml file.\"\"\"\n    #     with open(config_file) as f:\n    #         data = yaml.safe_load(f)\n    #     return cls(**data)\n\n\nclass Lambda(nn.Module):\n    \"\"\"Module to create a lambda function as nn.Module.\n\n    Args:\n        fcn: a pointer to any function.\n\n    Example:\n        >>> import torch\n        >>> import kornia as K\n        >>> fcn = Lambda(lambda x: K.geometry.resize(x, (32, 16)))\n        >>> fcn(torch.rand(1, 4, 64, 32)).shape\n        torch.Size([1, 4, 32, 16])\n    \"\"\"\n\n    def __init__(self, fcn):\n        super().__init__()\n        self.fcn = fcn\n\n    def forward(self, x):\n        return self.fcn(x)\n\n\nclass StatsTracker:\n    \"\"\"Stats tracker for computing metrics on the fly.\"\"\"\n\n    def __init__(self) -> None:\n        self._stats: Dict[str, AverageMeter] = {}\n\n    @property\n    def stats(self):\n        return self._stats\n\n    def update(self, key: str, val: float, batch_size: int) -> None:\n        \"\"\"Update the stats by the key value pair.\"\"\"\n        if key not in self._stats:\n            self._stats[key] = AverageMeter()\n        self._stats[key].update(val, batch_size)\n\n    def update_from_dict(self, dic: Dict[str, float], batch_size: int) -> None:\n        \"\"\"Update the stats by the dict.\"\"\"\n        for k, v in dic.items():\n            self.update(k, v, batch_size)\n\n    def __repr__(self) -> str:\n        return \" \".join([f\"{k.upper()}: {v.val:.2f} {v.val:.2f} \" for k, v in self._stats.items()])\n\n    def as_dict(self) -> Dict[str, AverageMeter]:\n        \"\"\"Return the dict format.\"\"\"\n        return self._stats\n", "path": "kornia/x/utils.py"}, {"content": "# Welcome to the Kornia setup.py.\nimport sys\n\n# Make sure that kornia is running on Python 3.7.0 or later\n# (to avoid running into this bug: https://bugs.python.org/issue29246)\n\nif sys.version_info < (3, 7, 0):\n    raise RuntimeError(\"Kornia requires Python 3.7.0 or later.\")\n\n\nfrom setuptools import setup\n\nsetup()\n", "path": "setup.py"}, {"content": "from typing import TYPE_CHECKING, List, Optional, Tuple\n\nimport torch\nfrom torch import Tensor\n\nfrom packaging import version\n\n\ndef torch_version() -> str:\n    \"\"\"Parse the `torch.__version__` variable and removes +cu*/cpu.\"\"\"\n    return torch.__version__.split('+')[0]\n\n\n# TODO: replace by torch_version_ge``\ndef torch_version_geq(major, minor) -> bool:\n    _version = version.parse(torch_version())\n    return _version >= version.parse(f\"{major}.{minor}\")\n\n\ndef torch_version_lt(major: int, minor: int, patch: int) -> bool:\n    _version = version.parse(torch_version())\n    return _version < version.parse(f\"{major}.{minor}.{patch}\")\n\n\ndef torch_version_le(major: int, minor: int, patch: int) -> bool:\n    _version = version.parse(torch_version())\n    return _version <= version.parse(f\"{major}.{minor}.{patch}\")\n\n\ndef torch_version_ge(major: int, minor: int, patch: int) -> bool:\n    _version = version.parse(torch_version())\n    return _version >= version.parse(f\"{major}.{minor}.{patch}\")\n\n\nif version.parse(torch_version()) > version.parse(\"1.7.1\"):\n    from torch.linalg import qr as linalg_qr\nelse:\n    from torch import qr as linalg_qr  # noqa: F401\n\n\nif torch_version_ge(1, 10, 0):\n\n    if not TYPE_CHECKING:\n\n        def torch_meshgrid(tensors: List[Tensor], indexing: str):\n            return torch.meshgrid(tensors, indexing=indexing)\n\nelse:\n\n    if TYPE_CHECKING:\n\n        def torch_meshgrid(tensors: List[Tensor], indexing: Optional[str] = None) -> Tuple[Tensor, ...]:\n            return torch.meshgrid(tensors)\n\n    else:\n\n        def torch_meshgrid(tensors: List[Tensor], indexing: str):\n            return torch.meshgrid(tensors)\n\n\nif torch_version_ge(1, 10, 0):\n    torch_inference_mode = torch.inference_mode\nelse:\n    torch_inference_mode = torch.no_grad\n", "path": "kornia/utils/_compat.py"}]}