def METHOD_NAME(path, gitignore_matcher):
    for child in path.iterdir():
        # Skip gitignored files
        if gitignore_matcher.match(child):
            return
        # For directories, keep recursing unless folder is blacklisted
        if child.is_dir():
            # Skip hidden folders
            if child.relative_to(child.parent).as_posix().startswith('.'):
                continue
            relpath = child.relative_to(check_path)
            # Skip blacklisted folders
            if relpath in ignoreset:
                continue
            yield from METHOD_NAME(child, gitignore_matcher.for_path(path))
            continue
        # Skip non-python files
        if child.suffix == '.py':
            yield child