nodes: 0, module; 1, function_definition; 2, function_name:rank_dated_files; 3, parameters; 4, block; 5, identifier:pattern; 6, identifier:dir; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, identifier:descending; 12, True; 13, comment:"""Search a directory for files that match a pattern. Return an ordered list of these files by filename.
  
      Args:
          pattern: The glob pattern to search for.
          dir: Path to directory where the files will be searched for.
          descending: Default True, will sort alphabetically by descending order.
  
      Returns:
          list: Rank-ordered list by filename.
  
      """; 14, assignment; 15, call; 16, identifier:files; 17, call; 18, identifier:sorted; 19, argument_list; 20, attribute; 21, argument_list; 22, identifier:files; 23, keyword_argument; 24, identifier:glob; 25, identifier:glob; 26, call; 27, identifier:reverse; 28, identifier:descending; 29, attribute; 30, argument_list; 31, identifier:op; 32, identifier:join; 33, identifier:dir; 34, identifier:pattern
code: def rank_dated_files(pattern, dir, descending=True):
      """Search a directory for files that match a pattern. Return an ordered list of these files by filename.
  
      Args:
          pattern: The glob pattern to search for.
          dir: Path to directory where the files will be searched for.
          descending: Default True, will sort alphabetically by descending order.
  
      Returns:
          list: Rank-ordered list by filename.
  
      """
      files = glob.glob(op.join(dir, pattern))
      return sorted(files, reverse=descending)