nodes: 0, module; 1, function_definition; 2, function_name:print_table; 3, parameters; 4, block; 5, identifier:title; 6, identifier:headers; 7, identifier:rows; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, expression_statement; 13, expression_statement; 14, identifier:sort_columns; 15, None; 16, comment:"""
      Print a table of rows with headers using tabulate.
  
        Parameters:
  
          title (:term: string):
            String that will be output before the Table.
  
          headers (list or tuple):
            List of strings that defines the header for each row.  Each string
            in this list may be multiline by inserting EOL in the string
  
          rows (iterable of iterables)
              The outer iterable is the rows. The inner iterables are the colums
              for each row
  
          args (int or list of int that defines sort)
              Defines the cols that will be sorted. If int, it defines the column
              that will be sorted. If list of int, the sort is in sort order of
              cols in the list (i.e. minor sorts to the left, major sorts to the
              right)
      """; 17, comparison_operator:sort_columns is not None; 18, block; 19, identifier:title; 20, block; 21, else_clause; 22, call; 23, call; 24, identifier:sort_columns; 25, None; 26, if_statement; 27, expression_statement; 28, block; 29, identifier:print; 30, argument_list; 31, identifier:print; 32, argument_list; 33, call; 34, block; 35, elif_clause; 36, else_clause; 37, call; 38, expression_statement; 39, call; 40, string; 41, identifier:isinstance; 42, argument_list; 43, expression_statement; 44, call; 45, block; 46, block; 47, identifier:print; 48, argument_list; 49, call; 50, attribute; 51, argument_list; 52, identifier:sort_columns; 53, identifier:int; 54, assignment; 55, identifier:isinstance; 56, argument_list; 57, expression_statement; 58, assert_statement; 59, binary_operator:'\n%s:' % title; 60, identifier:print; 61, argument_list; 62, identifier:tabulate; 63, identifier:tabulate; 64, identifier:rows; 65, identifier:headers; 66, keyword_argument; 67, identifier:rows; 68, call; 69, identifier:sort_columns; 70, tuple; 71, assignment; 72, False; 73, string:"Sort_columns must be int or list/tuple of int"; 74, string; 75, identifier:title; 76, string; 77, identifier:tablefmt; 78, string; 79, identifier:sorted; 80, argument_list; 81, identifier:list; 82, identifier:tuple; 83, identifier:rows; 84, call; 85, string_content; 86, string_content:simple; 87, identifier:rows; 88, keyword_argument; 89, identifier:sorted; 90, argument_list; 91, escape_sequence:\n; 92, identifier:key; 93, call; 94, identifier:rows; 95, keyword_argument; 96, identifier:itemgetter; 97, argument_list; 98, identifier:key; 99, call; 100, identifier:sort_columns; 101, identifier:itemgetter; 102, argument_list; 103, list_splat; 104, identifier:sort_columns
code: def print_table(title, headers, rows, sort_columns=None):
      """
      Print a table of rows with headers using tabulate.
  
        Parameters:
  
          title (:term: string):
            String that will be output before the Table.
  
          headers (list or tuple):
            List of strings that defines the header for each row.  Each string
            in this list may be multiline by inserting EOL in the string
  
          rows (iterable of iterables)
              The outer iterable is the rows. The inner iterables are the colums
              for each row
  
          args (int or list of int that defines sort)
              Defines the cols that will be sorted. If int, it defines the column
              that will be sorted. If list of int, the sort is in sort order of
              cols in the list (i.e. minor sorts to the left, major sorts to the
              right)
      """
      if sort_columns is not None:
          if isinstance(sort_columns, int):
              rows = sorted(rows, key=itemgetter(sort_columns))
          elif isinstance(sort_columns, (list, tuple)):
              rows = sorted(rows, key=itemgetter(*sort_columns))
          else:
              assert False, "Sort_columns must be int or list/tuple of int"
  
      if title:
          print('\n%s:' % title)
      else:
          print('')
  
      print(tabulate.tabulate(rows, headers, tablefmt='simple'))
      print('')