code: def match_paths(
      path_pattern, format_dict=None, default_format="\\w+"
  ):
      """Given a pattern, return a list of matches with tag values.
  
      E.g. converts
          '/path/to/experiments/{model}/{task}'
      to a list of dicts:
          {
              "model": ...,
              "task": ...,
              "path": ...,
          }
  
      Args:
          path_pattern: str
              Also used as input `tag_pattern` to tags_to_regex
          format_dict: Dict[str, str]
              See: tags_to_regex
          default_format: str
              See: tags_to_regex
  
      Returns: List[dict]
          List of matches
      """
      path_ls = sorted(glob.glob(re.sub(r"{(\w+)}", "*", path_pattern)))
      return match_path_ls(
          path_ls=path_ls,
          path_pattern=path_pattern,
          format_dict=format_dict,
          default_format=default_format,
      )
  
imports: import glob
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: match_paths(path_pattern, format_dict, default_format) and returns: match_path_ls