def _has_init(directory):
mod_or_pack = os.path.join(directory, "<STR_LIT>")<EOL>for ext in PY_SOURCE_EXTS + ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>if os.path.exists(mod_or_pack + "<STR_LIT:.>" + ext):<EOL><INDENT>return mod_or_pack + "<STR_LIT:.>" + ext<EOL><DEDENT><DEDENT>return None<EOL>
if the given directory has a valid __init__ file, return its path,
    else return None