class_docstr: Configuration for Datasets to pass to the training workers.
  
  dataset_or_dict: An optional Dataset or a dictionary of
      datasets to be sharded across all the training workers, which can be accessed
      from the training function via ``ray.train.get_dataset_shard()``. Multiple
      Datasets can be passed in as a dictionary that maps each name key to a
      Dataset value, and each Dataset can be accessed from the training function
      by passing in a `dataset_name` argument to ``ray.train.get_dataset_shard()``.
  dataset_split_fn: An optional callable to specify how the provided ``dataset``
      should be split across the training workers. It is expected to take in two
      arguments. The first one is the ``dataset``, just as is passed in to the
      ``_RayDatasetSpec``. The second argument is a list of the ActorHandles of the
      training workers (to use as locality hints). The Callable is expected to
      return a list of Datasets or a list of dictionaries of Datasets,
      with the length of the list equal to the length of the list of actor handles.
      If None is provided, the provided Dataset(s) will be equally split.
code: def _default_split_fn(
      self, training_worker_handles: List[ActorHandle]
  ) -> List[Optional[Union[Dataset, Dict[str, Dataset]]]]:
      def split_dataset(dataset_or_pipeline):
          return dataset_or_pipeline.split(
              len(training_worker_handles),
              equal=True,
              locality_hints=training_worker_handles,
          )
  
      if isinstance(self.dataset_or_dict, dict):
          # Return a smaller dict for each shard.
          dataset_shards = [
              {} for _ in range(len(training_worker_handles))
          ]
          for key, dataset in self.dataset_or_dict.items():
              split_datasets = split_dataset(dataset)
              assert len(split_datasets) == len(training_worker_handles)
              for i in range(len(split_datasets)):
                  dataset_shards[i][key] = split_datasets[i]
          return dataset_shards
      else:
          # return a smaller Dataset for each shard.
          return split_dataset(self.dataset_or_dict)
  
imports: from dataclasses import dataclass
  from typing import Callable, Dict, List, Optional, Union
  from ray.actor import ActorHandle
  from ray.data import Dataset
label_desc: Use image node_id 1 for calling the RayDatasetSpec obj's underlying member method code with example usage: obj._default_split_fn(training_worker_handles) and returns: dataset_or_pipeline, dataset_shards, split_dataset