def find_spec(name, package=None):
 fullname = (resolve_name(name, package) if name.startswith('.') else name)
 if (fullname not in sys.modules):
  parent_name = fullname.rpartition('.')[0]
  if parent_name:
   parent = __import__(parent_name, fromlist=['__path__'])
   return _find_spec(fullname, parent.__path__)
  else:
   return _find_spec(fullname, None)
 else:
  module = sys.modules[fullname]
  if (module is None):
   return None
  try:
   spec = module.__spec__
  except AttributeError:
   raise ValueError('{}.__spec__ is not set'.format(name))
  else:
   if (spec is None):
    raise ValueError('{}.__spec__ is None'.format(name))
   return spec

def find_spec ( name , package = None ) : fullname = ( resolve_name ( name , package ) if name . startswith ( '.' ) else name ) if ( fullname not in sys . modules ) : parent_name = fullname . rpartition ( '.' ) [ 0 ] if parent_name : parent = __import__ ( parent_name , fromlist = [ '__path__' ] ) return _find_spec ( fullname , parent . __path__ ) else : return _find_spec ( fullname , None ) else : module = sys . modules [ fullname ] if ( module is None ) : return None try : spec = module . __spec__ except AttributeError : raise ValueError ( '{}.__spec__ is not set' . format ( name ) ) else : if ( spec is None ) : raise ValueError ( '{}.__spec__ is None' . format ( name ) ) return spec
return the spec for the specified module .