docstr: Creates a list of handles to parallel processes handles that are used for submitting sampling
  tasks.
  
  Parameters
  ----------
  train_data, disc_perc, **kwargs
      See :py:meth:`alibi.explainers.anchors.anchor_tabular.AnchorTabular.fit` superclass.
docstr_tok: ["Creates","a","list","of","handles","to","parallel","processes","handles","that","are","used","for","submitting","sampling","tasks",".","Parameters","--","--","--","--","--","train_data",",","disc_perc",",","*","*","kwargs","See",":","py",":","meth",":","`","alibi.explainers.anchors.anchor_tabular.AnchorTabular.fit","`","superclass","."]
code: def fit(
      self,  # type: ignore[override]
      train_data: np.ndarray,
      disc_perc: tuple = (25, 50, 75),
      **kwargs,
  ) -> "AnchorTabular":
      """
      Creates a list of handles to parallel processes handles that are used for submitting sampling
      tasks.
  
      Parameters
      ----------
      train_data, disc_perc, **kwargs
          See :py:meth:`alibi.explainers.anchors.anchor_tabular.AnchorTabular.fit` superclass.
      """
  
      try:
          ncpu = kwargs["ncpu"]
      except KeyError:
          logging.warning(
              "DistributedAnchorTabular object has been initalised but kwargs did not contain "
              "expected argument, ncpu. Defaulting to ncpu=2!"
          )
          ncpu = 2
  
      # transform one-hot encodings to labels if ohe == True
      train_data = (
          ohe_to_ord(X_ohe=train_data, cat_vars_ohe=self.cat_vars_ohe)[
              0
          ]
          if self.ohe
          else train_data
      )
  
      disc = Discretizer(
          train_data,
          self.numerical_features,
          self.feature_names,
          percentiles=disc_perc,
      )
      d_train_data = disc.discretize(train_data)
  
      self.feature_values.update(disc.feature_intervals)
  
      sampler_args = (
          self._predictor,
          disc_perc,
          self.numerical_features,
          self.categorical_features,
          self.feature_names,
          self.feature_values,
      )
      train_data_id = ray.put(train_data)
      d_train_data_id = ray.put(d_train_data)
      samplers = [TabularSampler(*sampler_args, seed=self.seed) for _ in range(ncpu)]  # type: ignore[arg-type]
      d_samplers = []
      for sampler in samplers:
          d_samplers.append(
              ray.remote(RemoteSampler).remote(  # type: ignore[call-arg]
                  *(train_data_id, d_train_data_id, sampler)
              )
          )
      self.samplers = d_samplers
  
      # update metadata
      self.meta["params"].update(disc_perc=disc_perc)
  
      return self
  
imports: import logging
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
  import numpy
  import ray
  from alibi.api.interfaces import Explanation
  from alibi.utils.discretizer import Discretizer
  from alibi.utils.mapping import ohe_to_ord
  from .anchor_base import AnchorBaseBeam
  from .anchor_tabular import AnchorTabular, TabularSampler
  from alibi.utils.distributed import ActorPool
  from functools import partial
label_desc: Use image node_id 2 for calling the DistributedAnchorTabular obj's underlying member method code with example usage: obj.fit(train_data, disc_perc) and returns: self