environment/lib/python2.7/site-packages/nose/util.py
def ispackage(path):
    """
    Is this path a package directory?

    >>> ispackage('nose')
    True
    >>> ispackage('unit_tests')
    False
    >>> ispackage('nose/plugins')
    True
    >>> ispackage('nose/loader.py')
    False
    """
    if os.path.isdir(path):
        # at least the end of the path must be a legal python identifier
        # and __init__.py[co] must exist
        end = os.path.basename(path)
        if ident_re.match(end):
            for init in ('__init__.py', '__init__.pyc', '__init__.pyo'):
                if os.path.isfile(os.path.join(path, init)):
                    return True
            if sys.platform.startswith('java') and \
                    os.path.isfile(os.path.join(path, '__init__$py.class')):
                return True
    return False
def ispackage(path):
    if os.path.isdir(path):
        # at least the end of the path must be a legal python identifier
        # and __init__.py[co] must exist
        end = os.path.basename(path)
        if ident_re.match(end):
            for init in ('__init__.py', '__init__.pyc', '__init__.pyo'):
                if os.path.isfile(os.path.join(path, init)):
                    return True
            if sys.platform.startswith('java') and \
                    os.path.isfile(os.path.join(path, '__init__$py.class')):
                return True
    return False
def ispackage ( path ) : if os . path . isdir ( path ) : # at least the end of the path must be a legal python identifier # and __init__.py[co] must exist end = os . path . basename ( path ) if ident_re . match ( end ) : for init in ( '__init__.py' , '__init__.pyc' , '__init__.pyo' ) : if os . path . isfile ( os . path . join ( path , init ) ) : return True if sys . platform . startswith ( 'java' ) and os . path . isfile ( os . path . join ( path , '__init__$py.class' ) ) : return True return False
Is this path a package directory?

    >>> ispackage('nose')
    True
    >>> ispackage('unit_tests')
    False
    >>> ispackage('nose/plugins')
    True
    >>> ispackage('nose/loader.py')
    False
Is this path a package directory?