def walk_source()

in scripts/copyright_headers.py [0:0]


def walk_source(paths):
    # Find all Python source files that are not Git ignored
    source_files = set()
    for path in paths:
        for root, _, files in os.walk(path):
            for name in files:
                full_name = os.path.join(root, name)
                if name.endswith(".py") and os.system(
                    f"git check-ignore -q {full_name}"
                ):
                    source_files.add(full_name)

    return sorted(source_files)