code: def to_tf(
      ds: Dataset,
      feature_columns: Union[str, List[str]],
      label_columns: Union[str, List[str]],
      batch_size: Optional[int] = None,
      local_shuffle_buffer_size: Optional[int] = None,
      use_default_params: bool = False,
  ) -> Dataset:
      if use_default_params:
          ds.to_tf(
              feature_columns=feature_columns,
              label_columns=label_columns,
          )
      else:
          ds.to_tf(
              feature_columns=feature_columns,
              label_columns=label_columns,
              batch_size=batch_size,
              local_shuffle_buffer_size=local_shuffle_buffer_size,
          )
      return ds
  
file_path: ray/release/nightly_tests/dataset/iter_tensor_batches_benchmark.py
imports: import argparse
  import numpy
  from typing import Optional, Union, List
  import ray
  from ray.data.dataset import Dataset
  from benchmark import Benchmark
label_desc: Use image node_id 2 for calling a global function with example usage: to_tf(ds, feature_columns, label_columns, batch_size, local_shuffle_buffer_size, use_default_params) and returns: ds