prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  MyPy: improve ignite.base module
  ## 🚀 Feature
  
  Currently, mypy ignores all errors for all modules. We have to rework our typing such that mypy checks the code.
  In this issue, let's improve https://github.com/pytorch/ignite/tree/master/ignite/base module such that mypy passes on it.
  
  For Hacktoberfest contributors, feel free to ask questions for details if any and say that you would like to tackle the issue.
  Please, take a look at CONTRIBUTING guide.
  Improve typing for ignite.handlers module (1343)
  Fixes #1343 
  
  Description:
  
  Improves typing (when possible) for `ignite.handlers` module.
  
  Check list:
  * [x] New tests are added (if a new feature is added)
  * [ ] New doc strings: description and/or example code are in RST format
  * [ ] Documentation is updated (if required)
  
  
  </issue>
  <code>
  [start of ignite/base/mixins.py]
  1 from collections import OrderedDict
  2 from collections.abc import Mapping
  3 
  4 
  5 class Serializable:
  6 
  7     _state_dict_all_req_keys = ()
  8     _state_dict_one_of_opt_keys = ()
  9 
  10     def state_dict(self) -> OrderedDict:
  11         pass
  12 
  13     def load_state_dict(self, state_dict: Mapping) -> None:
  14         if not isinstance(state_dict, Mapping):
  15             raise TypeError("Argument state_dict should be a dictionary, but given {}".format(type(state_dict)))
  16 
  17         for k in self._state_dict_all_req_keys:
  18             if k not in state_dict:
  19                 raise ValueError(
  20                     "Required state attribute '{}' is absent in provided state_dict '{}'".format(k, state_dict.keys())
  21                 )
  22         opts = [k in state_dict for k in self._state_dict_one_of_opt_keys]
  23         if len(opts) > 0 and ((not any(opts)) or (all(opts))):
  24             raise ValueError("state_dict should contain only one of '{}' keys".format(self._state_dict_one_of_opt_keys))
  25
  [end of ignite/base/mixins.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/ignite/base/mixins.py b/ignite/base/mixins.py
  --- a/ignite/base/mixins.py
  +++ b/ignite/base/mixins.py
  @@ -4,8 +4,8 @@
   
   class Serializable:
   
  -    _state_dict_all_req_keys = ()
  -    _state_dict_one_of_opt_keys = ()
  +    _state_dict_all_req_keys = ()  # type: tuple
  +    _state_dict_one_of_opt_keys = ()  # type: tuple
   
       def state_dict(self) -> OrderedDict:
           pass
  
verification_info: {"golden_diff": "diff --git a/ignite/base/mixins.py b/ignite/base/mixins.py\n--- a/ignite/base/mixins.py\n+++ b/ignite/base/mixins.py\n@@ -4,8 +4,8 @@\n \n class Serializable:\n \n-    _state_dict_all_req_keys = ()\n-    _state_dict_one_of_opt_keys = ()\n+    _state_dict_all_req_keys = ()  # type: tuple\n+    _state_dict_one_of_opt_keys = ()  # type: tuple\n \n     def state_dict(self) -> OrderedDict:\n         pass\n", "issue": "MyPy: improve ignite.base module\n## \ud83d\ude80 Feature\r\n\r\nCurrently, mypy ignores all errors for all modules. We have to rework our typing such that mypy checks the code.\r\nIn this issue, let's improve https://github.com/pytorch/ignite/tree/master/ignite/base module such that mypy passes on it.\r\n\r\nFor Hacktoberfest contributors, feel free to ask questions for details if any and say that you would like to tackle the issue.\r\nPlease, take a look at CONTRIBUTING guide.\nImprove typing for ignite.handlers module (1343)\nFixes #1343 \r\n\r\nDescription:\r\n\r\nImproves typing (when possible) for `ignite.handlers` module.\r\n\r\nCheck list:\r\n* [x] New tests are added (if a new feature is added)\r\n* [ ] New doc strings: description and/or example code are in RST format\r\n* [ ] Documentation is updated (if required)\r\n\n", "before_files": [{"content": "from collections import OrderedDict\nfrom collections.abc import Mapping\n\n\nclass Serializable:\n\n    _state_dict_all_req_keys = ()\n    _state_dict_one_of_opt_keys = ()\n\n    def state_dict(self) -> OrderedDict:\n        pass\n\n    def load_state_dict(self, state_dict: Mapping) -> None:\n        if not isinstance(state_dict, Mapping):\n            raise TypeError(\"Argument state_dict should be a dictionary, but given {}\".format(type(state_dict)))\n\n        for k in self._state_dict_all_req_keys:\n            if k not in state_dict:\n                raise ValueError(\n                    \"Required state attribute '{}' is absent in provided state_dict '{}'\".format(k, state_dict.keys())\n                )\n        opts = [k in state_dict for k in self._state_dict_one_of_opt_keys]\n        if len(opts) > 0 and ((not any(opts)) or (all(opts))):\n            raise ValueError(\"state_dict should contain only one of '{}' keys\".format(self._state_dict_one_of_opt_keys))\n", "path": "ignite/base/mixins.py"}]}