def _find_spec_from_path(name, path=None):
 if (name not in sys.modules):
  return _find_spec(name, path)
 else:
  module = sys.modules[name]
  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_from_path ( name , path = None ) : if ( name not in sys . modules ) : return _find_spec ( name , path ) else : module = sys . modules [ name ] 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 .