def _has_init(directory):
 mod_or_pack = join(directory, '__init__')
 for ext in (PY_SOURCE_EXTS + ('pyc', 'pyo')):
  if exists(((mod_or_pack + '.') + ext)):
   return ((mod_or_pack + '.') + ext)
 return None

def _has_init ( directory ) : mod_or_pack = join ( directory , '__init__' ) for ext in ( PY_SOURCE_EXTS + ( 'pyc' , 'pyo' ) ) : if exists ( ( ( mod_or_pack + '.' ) + ext ) ) : return ( ( mod_or_pack + '.' ) + ext ) return None
if the given directory has a valid __init__ file .