code: def _consolidate(self, column):
      if isinstance(column, list):
          if column and all(
              isinstance(x, np.ndarray)
              and x.shape == column[0].shape
              and x.dtype == column[0].dtype
              for x in column
          ):
              return np.stack(column)
          else:
              # don't use np.array(column, dtype=object)
              # since it fails in certain cases
              # see https://stackoverflow.com/q/51005699
              out = np.empty(len(column), dtype=object)
              out[:] = column
              return out
      return column
  
file_path: datasets/src/datasets/formatting/np_formatter.py
imports: import sys
  from collections.abc import Mapping
  import numpy
  import pyarrow
  from ..None import config
  from ..utils.py_utils import map_nested
  from .formatting import TensorFormatter
label_desc: Use image node_id 2 for calling the NumpyFormatter obj's underlying member method code with example usage: obj._consolidate(column) and returns: column, np, out