code: def annotations_module(md):
      
      if isinstance(md, str):
          if md in sys.modules:
              md = sys.modules[md]
              if md is None:
                  return md
          elif md in pytypes.typechecker._pending_modules:
              # if import is pending, we just store this call for later
              pytypes.typechecker._pending_modules[md].append(annotations_module)
              return md
      assert(ismodule(md))
      if md.__name__ in pytypes.typechecker._pending_modules:
              # if import is pending, we just store this call for later
              pytypes.typechecker._pending_modules[md.__name__].append(annotations_module)
              # we already process the module now as far as possible for its internal use
              # todo: Issue warning here that not the whole module might be covered yet
      if md.__name__ in _annotated_modules and \
              _annotated_modules[md.__name__] == len(md.__dict__):
          return md
      # To play it safe we avoid to modify the dict while iterating over it,
      # so we previously cache keys.
      # For this we don't use keys() because of Python 3.
      # Todo: Better use inspect.getmembers here
      keys = [key for key in md.__dict__]
      for key in keys:
          memb = md.__dict__[key]
          if _check_as_func(memb) and memb.__module__ == md.__name__:
              annotations_func(memb)
          elif isclass(memb) and memb.__module__ == md.__name__:
              annotations_class(memb)
      if not md.__name__ in pytypes.typechecker._pending_modules:
          _annotated_modules[md.__name__] = len(md.__dict__)
      return md
docs: Works like annotations, but is only applicable to modules (by explicit call).
      md must be a module or a module name contained in sys.modules.