from pathlib import Path


def find_files(path, pattern="*"):
    """
    Get all files under this path

    :param path: files dir
    :param pattern:
        All files are returned by default, and the file type can also be customized,
        for example: pattern="*.py"
    :return:
    """
    if not Path(path).is_dir():
        print("The path params is not dir, no files can be found!")
        return []
    return [str(file.resolve()) for file in Path(path).rglob(pattern) if Path(file).is_file()]