nodes: 0, module; 1, function_definition; 2, function_name:arrange; 3, parameters; 4, block; 5, identifier:df; 6, list_splat_pattern; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, identifier:args; 15, identifier:kwargs; 16, comment:"""Calls `pandas.DataFrame.sort_values` to sort a DataFrame according to
      criteria.
  
      See:
      http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sort_values.html
  
      For a list of specific keyword arguments for sort_values (which will be
      the same in arrange).
  
      Args:
          *args: Symbolic, string, integer or lists of those types indicating
              columns to sort the DataFrame by.
  
      Kwargs:
          **kwargs: Any keyword arguments will be passed through to the pandas
              `DataFrame.sort_values` function.
      """; 17, assignment; 18, assignment; 19, assignment; 20, assignment; 21, subscript; 22, identifier:flat_args; 23, list_comprehension; 24, identifier:series; 25, list_comprehension; 26, identifier:sorter; 27, call; 28, identifier:sorter; 29, call; 30, attribute; 31, attribute; 32, slice; 33, identifier:a; 34, for_in_clause; 35, conditional_expression:df[arg] if isinstance(arg, str) else
                df.iloc[:, arg] if isinstance(arg, int) else
                pd.Series(arg); 36, for_in_clause; 37, attribute; 38, argument_list; 39, attribute; 40, argument_list; 41, identifier:df; 42, identifier:iloc; 43, identifier:sorter; 44, identifier:index; 45, identifier:a; 46, call; 47, subscript; 48, call; 49, conditional_expression:df.iloc[:, arg] if isinstance(arg, int) else
                pd.Series(arg); 50, identifier:arg; 51, identifier:flat_args; 52, call; 53, identifier:reset_index; 54, keyword_argument; 55, identifier:sorter; 56, identifier:sort_values; 57, call; 58, dictionary_splat; 59, identifier:flatten; 60, argument_list; 61, identifier:df; 62, identifier:arg; 63, identifier:isinstance; 64, argument_list; 65, subscript; 66, call; 67, call; 68, attribute; 69, argument_list; 70, identifier:drop; 71, True; 72, attribute; 73, argument_list; 74, identifier:kwargs; 75, identifier:args; 76, identifier:arg; 77, identifier:str; 78, attribute; 79, slice; 80, identifier:arg; 81, identifier:isinstance; 82, argument_list; 83, attribute; 84, argument_list; 85, identifier:pd; 86, identifier:concat; 87, identifier:series; 88, keyword_argument; 89, attribute; 90, identifier:tolist; 91, identifier:df; 92, identifier:iloc; 93, identifier:arg; 94, identifier:int; 95, identifier:pd; 96, identifier:Series; 97, identifier:arg; 98, identifier:axis; 99, integer:1; 100, identifier:sorter; 101, identifier:columns
code: def arrange(df, *args, **kwargs):
      """Calls `pandas.DataFrame.sort_values` to sort a DataFrame according to
      criteria.
  
      See:
      http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sort_values.html
  
      For a list of specific keyword arguments for sort_values (which will be
      the same in arrange).
  
      Args:
          *args: Symbolic, string, integer or lists of those types indicating
              columns to sort the DataFrame by.
  
      Kwargs:
          **kwargs: Any keyword arguments will be passed through to the pandas
              `DataFrame.sort_values` function.
      """
  
      flat_args = [a for a in flatten(args)]
  
      series = [df[arg] if isinstance(arg, str) else
                df.iloc[:, arg] if isinstance(arg, int) else
                pd.Series(arg) for arg in flat_args]
  
      sorter = pd.concat(series, axis=1).reset_index(drop=True)
      sorter = sorter.sort_values(sorter.columns.tolist(), **kwargs)
      return df.iloc[sorter.index, :]