def METHOD_NAME(d):
    base = Path(d)
    try:
        files = base.iterdir()
    except OSError:
        files = []
    for file_path in files:
        if file_path.is_file():
            m = syntax.re_filename.search(file_path.name)
            if m is not None:
                name, rev, in_format = m.groups()
                if not os.access(str(file_path), os.R_OK):
                    continue
                handle = in_format, str(file_path)
                self.modules.append((name, rev, handle))
        elif (not self.no_path_recurse
              and d != '.' and file_path.is_dir()):
            METHOD_NAME(file_path)