code: def send_to_data_service(
      dataset: tf.data.Dataset,
      compute_config: TfDataServiceConfig,
      rank: int,
      size: Optional[int] = None,
      processing_mode: str = "distributed_epoch",
      reuse_dataset: bool = False,
      round_robin: bool = False,
  ) -> tf.data.Dataset:
      if compute_config.dispatcher_side == "training":
          raise RuntimeError(
              "training side dispatcher not supported, use tf_data_service context manager instead"
          )
  
      with tf_data_service(compute_config, rank) as dispatcher_address:
          return dataset.apply(
              tf.data.experimental.service.distribute(
                  processing_mode=processing_mode,
                  service=dispatcher_address,
                  job_name="job" if reuse_dataset else None,
                  consumer_index=rank
                  if reuse_dataset and round_robin
                  else None,
                  num_consumers=size
                  if reuse_dataset and round_robin
                  else None,
              )
          )
  
imports: import binascii
  import dataclasses
  import json
  import logging
  import os
  import time
  from contextlib import contextmanager
  from pathlib import Path
  from tempfile import NamedTemporaryFile
  from typing import Mapping, Sequence, Tuple, Any, Optional
  import tensorflow
  import horovod.tensorflow
  from horovod.runner.common.service.compute_service import ComputeClient
label_desc: Use image node_id 2 for calling a global function with example usage: send_to_data_service(dataset, compute_config, rank, size, processing_mode, reuse_dataset, round_robin) and returns: dataset