code: def add(self, item: Union[dict, TableRow, np.ndarray]) -> None:
      if isinstance(item, TableRow):
          item = item.as_pydict()
      elif isinstance(item, np.ndarray):
          item = {TENSOR_COLUMN_NAME: item}
      if not isinstance(item, collections.abc.Mapping):
          raise ValueError(
              "Returned elements of an TableBlock must be of type `dict`, "
              "got {} (type {}).".format(item, type(item))
          )
  
      item_column_names = item.keys()
      if self._column_names is not None:
          # Check all added rows have same columns.
          if item_column_names != self._column_names:
              raise ValueError(
                  "Current row has different columns compared to previous rows. "
                  f"Columns of current row: {sorted(item_column_names)}, "
                  f"Columns of previous rows: {sorted(self._column_names)}."
              )
      else:
          # Initialize column names with the first added row.
          self._column_names = item_column_names
  
      for key, value in item.items():
          if is_array_like(value) and not isinstance(value, np.ndarray):
              value = np.array(value)
          self._columns[key].append(value)
      self._num_rows += 1
      self._compact_if_needed()
      self._uncompacted_size.add(item)
  
imports: import collections
  from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Mapping, TypeVar, Union
  import numpy
  from ray.air.constants import TENSOR_COLUMN_NAME
  from ray.data._internal.block_builder import BlockBuilder
  from ray.data._internal.numpy_support import convert_udf_returns_to_numpy, is_array_like
  from ray.data._internal.size_estimator import SizeEstimator
  from ray.data.block import Block, BlockAccessor
  from ray.data.row import TableRow
label_desc: Use image node_id 2 for calling the TableBlockBuilder obj's underlying member method code with example usage: obj.add(item) without return types