def METHOD_NAME(self, ctx):
    # check all dirs for yang and yin files
    self.modules = []
    def add_files_from_dir(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()):
                add_files_from_dir(file_path)
    for d in self.dirs:
        add_files_from_dir(d)