def fileList(paths, relative=False, folders=False):
    """
    Generate a recursive list of files from a given path.
    """

    try:
        basestring
    except __HOLE__:
        # Python 3
        basestring = unicode = str

    if isinstance(paths, basestring):
        paths = [paths]

    files = []

    for path in paths:
        for fileName in os.listdir(path):
            if fileName.startswith('.'):
                continue

            filePath = os.path.join(path, fileName)

            if os.path.isdir(filePath):
                if folders:
                    files.append(filePath)
                files += fileList(filePath)
            else:
                files.append(filePath)

        if relative:
            files = map(lambda x: x[len(path) + 1:], files)
    return files
dataset/ETHPy150Open randomknowledge/Cactus_Refactored/setup.py/fileList