code: def _aggregate(self, aggregations=[]):
      """
      Recursive aggregation allowing for TableSet's to be nested inside
      one another.
      """
      from agate.tableset import TableSet
  
      output = []
  
      # Process nested TableSet's
      if isinstance(self._values[0], TableSet):
          for key, nested_tableset in self.items():
              (
                  column_names,
                  column_types,
                  nested_output,
                  row_name_columns,
              ) = _aggregate(nested_tableset, aggregations)
  
              for row in nested_output:
                  row.insert(0, key)
  
                  output.append(row)
  
          column_names.insert(0, self._key_name)
          column_types.insert(0, self._key_type)
          row_name_columns.insert(0, self._key_name)
      # Regular Tables
      else:
          column_names = [self._key_name]
          column_types = [self._key_type]
          row_name_columns = [self._key_name]
  
          for new_column_name, aggregation in aggregations:
              column_names.append(new_column_name)
              column_types.append(
                  aggregation.get_aggregate_data_type(
                      self._sample_table
                  )
              )
  
          for name, table in self.items():
              for new_column_name, aggregation in aggregations:
                  aggregation.validate(table)
  
          for name, table in self.items():
              new_row = [name]
  
              for new_column_name, aggregation in aggregations:
                  new_row.append(aggregation.run(table))
  
              output.append(new_row)
  
      return column_names, column_types, output, row_name_columns
  
label_desc: Use image node_id 1 for calling a global function with example usage: _aggregate(aggregations) and returns: column_names,  column_types,  output,  row_name_columns