nodes: 0, module; 1, function_definition; 2, function_name:_FilterOutPathInfoDuplicates; 3, parameters; 4, block; 5, identifier:path_infos; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, function_definition; 10, for_statement; 11, return_statement; 12, comment:"""Filters out duplicates from passed PathInfo objects.
  
    Args:
      path_infos: An iterable with PathInfo objects.
  
    Returns:
      A list of PathInfo objects with duplicates removed. Duplicates are
      removed following this logic: they're sorted by (ctime, mtime, atime,
      inode number) in the descending order and then the first one is taken
      and the others are dropped.
    """; 13, assignment; 14, identifier:pi; 15, identifier:path_infos; 16, block; 17, function_name:_SortKey; 18, parameters; 19, block; 20, identifier:pi_values; 21, call; 22, block; 23, list_comprehension; 24, identifier:pi_dict; 25, dictionary; 26, expression_statement; 27, expression_statement; 28, identifier:pi; 29, return_statement; 30, attribute; 31, argument_list; 32, if_statement; 33, subscript; 34, for_in_clause; 35, assignment; 36, call; 37, tuple; 38, identifier:pi_dict; 39, identifier:values; 40, comparison_operator:len(pi_values) > 1; 41, block; 42, identifier:v; 43, integer:0; 44, identifier:v; 45, call; 46, identifier:path_key; 47, tuple; 48, attribute; 49, argument_list; 50, attribute; 51, attribute; 52, attribute; 53, attribute; 54, call; 55, integer:1; 56, expression_statement; 57, attribute; 58, argument_list; 59, attribute; 60, call; 61, call; 62, identifier:append; 63, identifier:pi; 64, attribute; 65, identifier:st_ctime; 66, attribute; 67, identifier:st_mtime; 68, attribute; 69, identifier:st_atime; 70, attribute; 71, identifier:st_ino; 72, identifier:len; 73, argument_list; 74, call; 75, identifier:pi_dict; 76, identifier:values; 77, identifier:pi; 78, identifier:path_type; 79, attribute; 80, argument_list; 81, attribute; 82, argument_list; 83, identifier:pi; 84, identifier:stat_entry; 85, identifier:pi; 86, identifier:stat_entry; 87, identifier:pi; 88, identifier:stat_entry; 89, identifier:pi; 90, identifier:stat_entry; 91, identifier:pi_values; 92, attribute; 93, argument_list; 94, identifier:pi; 95, identifier:GetPathID; 96, identifier:pi_dict; 97, identifier:setdefault; 98, identifier:path_key; 99, list; 100, identifier:pi_values; 101, identifier:sort; 102, keyword_argument; 103, keyword_argument; 104, identifier:key; 105, identifier:_SortKey; 106, identifier:reverse; 107, True
code: def _FilterOutPathInfoDuplicates(path_infos):
    """Filters out duplicates from passed PathInfo objects.
  
    Args:
      path_infos: An iterable with PathInfo objects.
  
    Returns:
      A list of PathInfo objects with duplicates removed. Duplicates are
      removed following this logic: they're sorted by (ctime, mtime, atime,
      inode number) in the descending order and then the first one is taken
      and the others are dropped.
    """
    pi_dict = {}
  
    for pi in path_infos:
      path_key = (pi.path_type, pi.GetPathID())
      pi_dict.setdefault(path_key, []).append(pi)
  
    def _SortKey(pi):
      return (
          pi.stat_entry.st_ctime,
          pi.stat_entry.st_mtime,
          pi.stat_entry.st_atime,
          pi.stat_entry.st_ino,
      )
  
    for pi_values in pi_dict.values():
      if len(pi_values) > 1:
        pi_values.sort(key=_SortKey, reverse=True)
  
    return [v[0] for v in pi_dict.values()]