prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `ignite/base/mixins.py`
  Content:
  ```
  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 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/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"}], "after_files": [{"content": "from collections import OrderedDict\nfrom collections.abc import Mapping\n\n\nclass Serializable:\n\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\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"}]}