def load_package(name, path):
 if os.path.isdir(path):
  extensions = (machinery.SOURCE_SUFFIXES[:] + machinery.BYTECODE_SUFFIXES[:])
  for extension in extensions:
   path = os.path.join(path, ('__init__' + extension))
   if os.path.exists(path):
    break
  else:
   raise ValueError('{!r} is not a package'.format(path))
 spec = util.spec_from_file_location(name, path, submodule_search_locations=[])
 if (name in sys.modules):
  return _exec(spec, sys.modules[name])
 else:
  return _load(spec)

def load_package ( name , path ) : if os . path . isdir ( path ) : extensions = ( machinery . SOURCE_SUFFIXES [ : ] + machinery . BYTECODE_SUFFIXES [ : ] ) for extension in extensions : path = os . path . join ( path , ( '__init__' + extension ) ) if os . path . exists ( path ) : break else : raise ValueError ( '{!r} is not a package' . format ( path ) ) spec = util . spec_from_file_location ( name , path , submodule_search_locations = [ ] ) if ( name in sys . modules ) : return _exec ( spec , sys . modules [ name ] ) else : return _load ( spec )
load package into the local registered namespace .