def isPackageDirectory(dirname):
    """
    Is the directory at path 'dirname' a Python package directory?
    Returns the name of the __init__ file (it may have a weird extension)
    if dirname is a package directory.  Otherwise, returns False
    """
    def _getSuffixes():
        if _PY3:
            import importlib
            return importlib.machinery.all_suffixes()
        else:
            import imp
            return list(zip(*imp.get_suffixes()))[0]


    for ext in _getSuffixes():
        initFile = '__init__' + ext
        if os.path.exists(os.path.join(dirname, initFile)):
            return initFile
    return False

    Is the directory at path 'dirname' a Python package directory?
    Returns the name of the __init__ file (it may have a weird extension)
    if dirname is a package directory.  Otherwise, returns False
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/runner.py