code: def legal_module_name(self, name):
          
          if name in self._legal_mnames:
              return self._legal_mnames[name]
  
          for part in name.split('.'):
              try:
                  exec("%s = 42" % part, {}, {})
              except:  # pragma: nocover
                  self._legal_mnames[name] = False
                  return False
          self._legal_mnames[name] = True
          return True
docs: Legal module names are dotted strings where each part
             is a valid Python identifier.
             (and not a keyword, and support unicode identifiers in
             Python3, ..)