class_docstr: Implements an ML preprocessing operation.
  
  Preprocessors are stateful objects that can be fitted against a Dataset and used
  to transform both local data batches and distributed data. For example, a
  Normalization preprocessor may calculate the mean and stdev of a field during
  fitting, and uses these attributes to implement its normalization transform.
  
  Preprocessors can also be stateless and transform data without needed to be fitted.
  For example, a preprocessor may simply remove a column, which does not require
  any state to be fitted.
  
  If you are implementing your own Preprocessor sub-class, you should override the
  following:
  
  * ``_fit`` if your preprocessor is stateful. Otherwise, set
    ``_is_fittable=False``.
  * ``_transform_pandas`` and/or ``_transform_numpy`` for best performance,
    implement both. Otherwise, the data will be converted to the match the
    implemented method.
code: def _transform(self, ds: "Dataset") -> "Dataset":
      # TODO(matt): Expose `batch_size` or similar configurability.
      # The default may be too small for some datasets and too large for others.
      transform_type = self._determine_transform_to_use()
  
      # Our user-facing batch format should only be pandas or NumPy, other
      # formats {arrow, simple} are internal.
      kwargs = self._get_transform_config()
      if transform_type == BatchFormat.PANDAS:
          return ds.map_batches(
              self._transform_pandas,
              batch_format=BatchFormat.PANDAS,
              **kwargs,
          )
      elif transform_type == BatchFormat.NUMPY:
          return ds.map_batches(
              self._transform_numpy,
              batch_format=BatchFormat.NUMPY,
              **kwargs,
          )
      else:
          raise ValueError(
              "Invalid transform type returned from _determine_transform_to_use; "
              f'"pandas" and "numpy" allowed, but got: {transform_type}'
          )
  
imports: import abc
  import base64
  import collections
  import pickle
  import warnings
  from enum import Enum
  from typing import TYPE_CHECKING, Any, Dict, Optional, Union
  from ray.air.util.data_batch_conversion import BatchFormat
  from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
label_desc: Use image node_id 10 for calling the Preprocessor obj's underlying member method code with example usage: obj._transform(ds) and returns: ds, ds