Return a list of all files found under directory (and its subdirectories)

def list_files(directory):
    '''
    Return a list of all files found under directory (and its subdirectories)
    '''
    ret = set()
    ret.add(directory)
    for root, dirs, files in safe_walk(directory):
        for name in files:
            ret.add(os.path.join(root, name))
        for name in dirs:
            ret.add(os.path.join(root, name))

    return list(ret)