def METHOD_NAME(paths, filter_=None):
    """
    :param paths: the directories to look into.
    :param filter_: None, or a predicate function returning True iff the file should be listed.
    """
    filter_ = filter_ or (lambda _: True)
    all_files = []
    paths = paths if isinstance(paths, list) else [paths]
    for path in paths:
        # path = normalize_path(path)
        if os.path.isdir(path):
            for root_dir, sub_dirs, files in os.walk(path):
                for name in files:
                    full_path = os.path.join(root_dir, name)
                    if filter_(full_path):
                        all_files.append(full_path)
        elif os.path.isfile(path):
            if filter_(path):
                all_files.append(path)
        else:
            log.warning("Skipping file `%s` as it doesn't exist.", path)
    return all_files