def is_on_path(name):
 for (loader, name_, ispkg) in pkgutil.iter_modules(sys.path):
  if (name == name_):
   return True
 else:
  return False

def is_on_path ( name ) : for ( loader , name_ , ispkg ) in pkgutil . iter_modules ( sys . path ) : if ( name == name_ ) : return True else : return False
is a top level package/module found on sys .