def find_file(filename, std_dirs, paths):

    # Check the standard locations
    for dir in std_dirs:
        f = os.path.join(dir, filename)
        print 'looking for', f
        if os.path.exists(f): return []

    # Check the additional directories
    for dir in paths:
        f = os.path.join(dir, filename)
        print 'looking for', f
        if os.path.exists(f):
            return [dir]

    # Not found anywhere
    return None
Searches for the directory where a given file is located,
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/ssl-1.15/setup.py/find_file