original_docstring: 
      Reorder each list in lists by the (descending) sorted order of keys.
  
      :param iter keys:
          Keys to order by.
      :param list[list] lists:
          Lists to reordered by keys's order.  Correctly handles lists and 1-D
          tensors.
      :param bool descending:
          Use descending order if true.
  
      :returns:
          The reordered items.
      
docstring: Reorder each list in lists by the (descending) sorted order of keys.
docstring_tokens: Reorder each list in lists by the ( descending ) sorted order of keys .
code: def argsort(keys: List[Any], *lists: List[List[Any]], descending: bool = False):
      """
      Reorder each list in lists by the (descending) sorted order of keys.
  
      :param iter keys:
          Keys to order by.
      :param list[list] lists:
          Lists to reordered by keys's order.  Correctly handles lists and 1-D
          tensors.
      :param bool descending:
          Use descending order if true.
  
      :returns:
          The reordered items.
      """
      ind_sorted = sorted(range(len(keys)), key=lambda k: keys[k])
      if descending:
          ind_sorted = list(reversed(ind_sorted))
      output = []
      for lst in lists:
          # watch out in case we don't have torch installed
          if isinstance(lst, torch.Tensor):
              output.append(lst[ind_sorted])
          else:
              output.append([lst[i] for i in ind_sorted])
      return output
code_tokens: def argsort ( keys : List [ Any ] , * lists : List [ List [ Any ] ] , descending : bool = False ) : ind_sorted = sorted ( range ( len ( keys ) ) , key = lambda k : keys [ k ] ) if descending : ind_sorted = list ( reversed ( ind_sorted ) ) output = [ ] for lst in lists : if isinstance ( lst , torch . Tensor ) : output . append ( lst [ ind_sorted ] ) else : output . append ( [ lst [ i ] for i in ind_sorted ] ) return output
short_docstring: Reorder each list in lists by the (descending) sorted order of keys.
short_docstring_tokens: Reorder each list in lists by the ( descending ) sorted order of keys .
comment: """
      Reorder each list in lists by the (descending) sorted order of keys.
  
      :param iter keys:
          Keys to order by.
      :param list[list] lists:
          Lists to reordered by keys's order.  Correctly handles lists and 1-D
          tensors.
      :param bool descending:
          Use descending order if true.
  
      :returns:
          The reordered items.
      """$SEP$# watch out in case we don't have torch installed