(
    root_path: str,
    relative_paths_to_search: List[str],
    file_pattern: str,
)
return matching
Given an absolute `root_path`, a list of relative paths to that
    absolute root path (`relative_paths_to_search`), and a `file_pattern`
    like '*.sql', returns information about the files. For example:

    > find_matching('/root/path', ['models'], '*.sql')

      [ { 'absolute_path': '/root/path/models/model_one.sql',
          'relative_path': 'model_one.sql',
          'searched_path': 'models' },
        { 'absolute_path': '/root/path/models/subdirectory/model_two.sql',
          'relative_path': 'subdirectory/model_two.sql',
          'searched_path': 'models' } ]
Given an absolute `root_path`, a list of relative paths to that
    absolute root path (`relative_paths_to_search`), and a `file_pattern`
    like '*.sql', returns information about the files. For example:
Given an absolute root_path a list of relative paths to that absolute root path ( relative_paths_to_search ) and a file_pattern like * . sql returns information about the files . For example :
def find_matching(
    root_path: str,
    relative_paths_to_search: List[str],
    file_pattern: str,
) -> List[Dict[str, Any]]:
    """
    Given an absolute `root_path`, a list of relative paths to that
    absolute root path (`relative_paths_to_search`), and a `file_pattern`
    like '*.sql', returns information about the files. For example:

    > find_matching('/root/path', ['models'], '*.sql')

      [ { 'absolute_path': '/root/path/models/model_one.sql',
          'relative_path': 'model_one.sql',
          'searched_path': 'models' },
        { 'absolute_path': '/root/path/models/subdirectory/model_two.sql',
          'relative_path': 'subdirectory/model_two.sql',
          'searched_path': 'models' } ]
    """
    matching = []
    root_path = os.path.normpath(root_path)
    regex = fnmatch.translate(file_pattern)
    reobj = re.compile(regex, re.IGNORECASE)

    for relative_path_to_search in relative_paths_to_search:
        absolute_path_to_search = os.path.join(
            root_path, relative_path_to_search)
        walk_results = os.walk(absolute_path_to_search)

        for current_path, subdirectories, local_files in walk_results:
            for local_file in local_files:
                absolute_path = os.path.join(current_path, local_file)
                relative_path = os.path.relpath(
                    absolute_path, absolute_path_to_search
                )
                modification_time = 0.0
                try:
                    modification_time = os.path.getmtime(absolute_path)
                except OSError:
                    fire_event(SystemErrorRetrievingModTime(path=absolute_path))
                if reobj.match(local_file):
                    matching.append({
                        'searched_path': relative_path_to_search,
                        'absolute_path': absolute_path,
                        'relative_path': relative_path,
                        'modification_time': modification_time,
                    })

    return matching
def find_matching ( root_path : str , relative_paths_to_search : List [ str ] , file_pattern : str , ) -> List [ Dict [ str , Any ] ] : matching = [ ] root_path = os . path . normpath ( root_path ) regex = fnmatch . translate ( file_pattern ) reobj = re . compile ( regex , re . IGNORECASE ) for relative_path_to_search in relative_paths_to_search : absolute_path_to_search = os . path . join ( root_path , relative_path_to_search ) walk_results = os . walk ( absolute_path_to_search ) for current_path , subdirectories , local_files in walk_results : for local_file in local_files : absolute_path = os . path . join ( current_path , local_file ) relative_path = os . path . relpath ( absolute_path , absolute_path_to_search ) modification_time = 0.0 try : modification_time = os . path . getmtime ( absolute_path ) except OSError : fire_event ( SystemErrorRetrievingModTime ( path = absolute_path ) ) if reobj . match ( local_file ) : matching . append ( { 'searched_path' : relative_path_to_search , 'absolute_path' : absolute_path , 'relative_path' : relative_path , 'modification_time' : modification_time , } ) return matching