def is_discoverable(label):
 try:
  mod = import_module(label)
 except (ImportError, TypeError):
  pass
 else:
  return hasattr(mod, '__path__')
 return os.path.isdir(os.path.abspath(label))

def is_discoverable ( label ) : try : mod = import_module ( label ) except ( ImportError , TypeError ) : pass else : return hasattr ( mod , '__path__' ) return os . path . isdir ( os . path . abspath ( label ) )
check if a test label points to a python package or file directory .