nodes: 0, module; 1, function_definition; 2, function_name:tabulate; 3, parameters; 4, block; 5, identifier:obj; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, if_statement; 19, if_statement; 20, expression_statement; 21, expression_statement; 22, expression_statement; 23, expression_statement; 24, expression_statement; 25, return_statement; 26, identifier:v_level_indexes; 27, None; 28, identifier:h_level_indexes; 29, None; 30, identifier:v_level_visibility; 31, None; 32, identifier:h_level_visibility; 33, None; 34, identifier:v_level_sort_keys; 35, None; 36, identifier:h_level_sort_keys; 37, None; 38, identifier:v_level_titles; 39, None; 40, identifier:h_level_titles; 41, None; 42, identifier:empty; 43, string:""; 44, comment:"""Render a nested data structure into a two-dimensional table.
  
      Args:
          obj: The indexable data structure to be rendered, which can
              either be a non-string sequence or a mapping containing other
              sequences and mappings nested to arbitrarily many levels,
              with all the leaf items (which are neither sequences nor
              mappings, excluding strings).
  
          v_level_indexes: An iterable of the zero-based indexes of
              the levels for which the keys/indexes will be displayed
              along the vertical axis of the table. Taken together
              with the levels in h_levels these must represent the
              complete set of levels in the obj data structure. No
              level index should appear in both v_level_indexes and
              h_level_indexes, but all level indexes must appear in
              either v_level_indexes or h_level_indexes. If None,
              the levels not used in h_level_indexes will be used.
              If both v_level_indexes and h_level_indexes are not
              alternate indexes will be used as v_level and h_level
              indexes.
  
          h_level_indexes: An iterable of the zero-based indexes of
              the levels for which the keys/indexes will be displayed
              along the horizontal axis of the table. Taken together
              with the levels in v_levels these must represent the
              complete set of levels in the obj data structure. No
              level index should appear in both h_level_indexes and
              v_level_indexes, but all level indexes must appear in
              either h_level_indexes or v_level_indexes. If None,
              the levels not used in v_level_indexes will be used.
              If both v_level_indexes and h_level_indexes are not
              alternate indexes will be used as v_level and h_level
              indexes.
  
          v_level_visibility: An optional iterable of booleans, where each
              item corresponds to a level in v_level_indexes, and
              controls whether than level of index is included in
              the table stub columns. This iterable must contain
              the same number of items as v_level_indexes.
  
          h_level_visibility: An optional iterable of booleans, where each
              item corresponds to a level in h_level_indexes, and
              controls whether than level of index is included in
              the table header rows. This iterable must contain
              the same number of items as h_level_indexes.
  
          v_level_sort_keys: An optional iterable of Keys, where each
              key corresponds to a level in v_level_indexes, and
              controls how that key is sorted. If None, keys are sorted
              as-is.
  
          h_level_sort_keys: An optional iterable of Keys, where each
              key corresponds to a level in v_level_indexes, and
              controls how that key is sorted. If None, keys are sorted
              as-is.
  
          v_level_titles: An optional iterable of strings, where each
              string is a title which corresponds to a level in v_level_indexes,
              and which will be displayed against the row keys for that level.
              If None, no titles will be included.
  
          h_level_titles: An optional iterable of strings, where each
              string is a title which corresponds to a level in h_level_indexes,
              and which will be displayed against the column keys for that level.
              If None, no titles will be included.
  
          empty: An optional string value to use for empty cells.
  
      Returns:
          A list of lists representing the rows of cells.
  
      Example:
  
          tabulate(dict_of_dicts, [0, 1], [])
  
      """; 45, assignment; 46, assignment; 47, comparison_operator:v_level_visibility is None; 48, block; 49, comparison_operator:h_level_visibility is None; 50, block; 51, assignment; 52, assignment; 53, assignment; 54, assignment; 55, assignment; 56, call; 57, identifier:level_keys; 58, call; 59, pattern_list; 60, call; 61, identifier:v_level_visibility; 62, None; 63, expression_statement; 64, identifier:h_level_visibility; 65, None; 66, expression_statement; 67, pattern_list; 68, call; 69, pattern_list; 70, call; 71, pattern_list; 72, call; 73, identifier:v_key_tuples; 74, call; 75, identifier:h_key_tuples; 76, call; 77, identifier:assemble_table; 78, argument_list; 79, identifier:breadth_first; 80, argument_list; 81, identifier:v_level_indexes; 82, identifier:h_level_indexes; 83, identifier:validate_level_indexes; 84, argument_list; 85, assignment; 86, assignment; 87, identifier:table; 88, identifier:v_key_tuples; 89, identifier:h_key_tuples; 90, identifier:tabulate_body; 91, argument_list; 92, identifier:table; 93, identifier:v_key_tuples; 94, identifier:strip_missing_rows; 95, argument_list; 96, identifier:table; 97, identifier:h_key_tuples; 98, identifier:strip_missing_columns; 99, argument_list; 100, identifier:strip_hidden; 101, argument_list; 102, identifier:strip_hidden; 103, argument_list; 104, identifier:table; 105, identifier:v_key_tuples; 106, identifier:h_key_tuples; 107, identifier:v_level_titles; 108, identifier:h_level_titles; 109, keyword_argument; 110, identifier:obj; 111, call; 112, identifier:v_level_indexes; 113, identifier:h_level_indexes; 114, identifier:v_level_visibility; 115, binary_operator:[True] * len(v_level_indexes); 116, identifier:h_level_visibility; 117, binary_operator:[True] * len(h_level_indexes); 118, identifier:obj; 119, identifier:level_keys; 120, identifier:v_level_indexes; 121, identifier:h_level_indexes; 122, identifier:v_level_sort_keys; 123, identifier:h_level_sort_keys; 124, identifier:table; 125, identifier:v_key_tuples; 126, identifier:table; 127, identifier:h_key_tuples; 128, identifier:v_key_tuples; 129, identifier:v_level_visibility; 130, identifier:h_key_tuples; 131, identifier:h_level_visibility; 132, identifier:empty; 133, identifier:empty; 134, identifier:len; 135, argument_list; 136, list; 137, call; 138, list; 139, call; 140, identifier:level_keys; 141, True; 142, identifier:len; 143, argument_list; 144, True; 145, identifier:len; 146, argument_list; 147, identifier:v_level_indexes; 148, identifier:h_level_indexes
code: def tabulate(
      obj,
      v_level_indexes=None,
      h_level_indexes=None,
      v_level_visibility=None,
      h_level_visibility=None,
      v_level_sort_keys=None,
      h_level_sort_keys=None,
      v_level_titles=None,
      h_level_titles=None,
      empty="",
  ):
      """Render a nested data structure into a two-dimensional table.
  
      Args:
          obj: The indexable data structure to be rendered, which can
              either be a non-string sequence or a mapping containing other
              sequences and mappings nested to arbitrarily many levels,
              with all the leaf items (which are neither sequences nor
              mappings, excluding strings).
  
          v_level_indexes: An iterable of the zero-based indexes of
              the levels for which the keys/indexes will be displayed
              along the vertical axis of the table. Taken together
              with the levels in h_levels these must represent the
              complete set of levels in the obj data structure. No
              level index should appear in both v_level_indexes and
              h_level_indexes, but all level indexes must appear in
              either v_level_indexes or h_level_indexes. If None,
              the levels not used in h_level_indexes will be used.
              If both v_level_indexes and h_level_indexes are not
              alternate indexes will be used as v_level and h_level
              indexes.
  
          h_level_indexes: An iterable of the zero-based indexes of
              the levels for which the keys/indexes will be displayed
              along the horizontal axis of the table. Taken together
              with the levels in v_levels these must represent the
              complete set of levels in the obj data structure. No
              level index should appear in both h_level_indexes and
              v_level_indexes, but all level indexes must appear in
              either h_level_indexes or v_level_indexes. If None,
              the levels not used in v_level_indexes will be used.
              If both v_level_indexes and h_level_indexes are not
              alternate indexes will be used as v_level and h_level
              indexes.
  
          v_level_visibility: An optional iterable of booleans, where each
              item corresponds to a level in v_level_indexes, and
              controls whether than level of index is included in
              the table stub columns. This iterable must contain
              the same number of items as v_level_indexes.
  
          h_level_visibility: An optional iterable of booleans, where each
              item corresponds to a level in h_level_indexes, and
              controls whether than level of index is included in
              the table header rows. This iterable must contain
              the same number of items as h_level_indexes.
  
          v_level_sort_keys: An optional iterable of Keys, where each
              key corresponds to a level in v_level_indexes, and
              controls how that key is sorted. If None, keys are sorted
              as-is.
  
          h_level_sort_keys: An optional iterable of Keys, where each
              key corresponds to a level in v_level_indexes, and
              controls how that key is sorted. If None, keys are sorted
              as-is.
  
          v_level_titles: An optional iterable of strings, where each
              string is a title which corresponds to a level in v_level_indexes,
              and which will be displayed against the row keys for that level.
              If None, no titles will be included.
  
          h_level_titles: An optional iterable of strings, where each
              string is a title which corresponds to a level in h_level_indexes,
              and which will be displayed against the column keys for that level.
              If None, no titles will be included.
  
          empty: An optional string value to use for empty cells.
  
      Returns:
          A list of lists representing the rows of cells.
  
      Example:
  
          tabulate(dict_of_dicts, [0, 1], [])
  
      """
      level_keys = breadth_first(obj)
  
      v_level_indexes, h_level_indexes = validate_level_indexes(
          len(level_keys), v_level_indexes, h_level_indexes
      )
  
      if v_level_visibility is None:
          v_level_visibility = [True] * len(v_level_indexes)
      if h_level_visibility is None:
          h_level_visibility = [True] * len(h_level_indexes)
  
      table, v_key_tuples, h_key_tuples = tabulate_body(
          obj, level_keys, v_level_indexes, h_level_indexes, v_level_sort_keys, h_level_sort_keys
      )
  
      table, v_key_tuples = strip_missing_rows(table, v_key_tuples)
      table, h_key_tuples = strip_missing_columns(table, h_key_tuples)
      v_key_tuples = strip_hidden(v_key_tuples, v_level_visibility)
      h_key_tuples = strip_hidden(h_key_tuples, h_level_visibility)
      return assemble_table(
          table, v_key_tuples, h_key_tuples, v_level_titles, h_level_titles, empty=empty
      )