def is_standard_module(modname, std_path=None):
 modname = modname.split('.')[0]
 try:
  filename = file_from_modpath([modname])
 except ImportError:
  return False
 if (filename is None):
  return True
 filename = _normalize_path(filename)
 if filename.startswith(_cache_normalize_path(EXT_LIB_DIR)):
  return False
 if (std_path is None):
  std_path = STD_LIB_DIRS
 for path in std_path:
  if filename.startswith(_cache_normalize_path(path)):
   return True
 return False

def is_standard_module ( modname , std_path = None ) : modname = modname . split ( '.' ) [ 0 ] try : filename = file_from_modpath ( [ modname ] ) except ImportError : return False if ( filename is None ) : return True filename = _normalize_path ( filename ) if filename . startswith ( _cache_normalize_path ( EXT_LIB_DIR ) ) : return False if ( std_path is None ) : std_path = STD_LIB_DIRS for path in std_path : if filename . startswith ( _cache_normalize_path ( path ) ) : return True return False
try to guess if a module is a standard python module :type modname: str .