code: def make_pipeline(
      data,
      preprocess_fn,
      batch_size,
      drop_remainder,
      cache="loaded",
      repeats=None,
      repeat_after_batching=False,
      shuffle_buffer_size=None,
      prefetch=2,
      ignore_errors=False,
      dataset_service_address=None,
  ):
      """Makes an input pipeline for `data`."""
      if cache not in ("loaded", "batched", False, None):
          raise ValueError(f"Unknown cache value {cache}")
  
      data = _add_tpu_host_options(data)
  
      if cache == "loaded":
          data = data.cache()
  
      if not repeat_after_batching:
          data = data.repeat(repeats)
  
      if shuffle_buffer_size is not None:
          data = data.shuffle(shuffle_buffer_size)
  
      data = data.map(
          preprocess_fn,
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
  
      if ignore_errors:
          # Skip broken images. This does not slow things down.
          data = data.apply(tf.data.experimental.ignore_errors())
  
      data = data.batch(batch_size, drop_remainder=drop_remainder)
  
      if cache == "batched":
          data = data.cache()
  
      if repeat_after_batching:
          data = data.repeat(repeats)
  
      if dataset_service_address:
          data = distribute(data, dataset_service_address)
  
      if prefetch == "autotune":
          data = data.prefetch(tf.data.experimental.AUTOTUNE)
      elif prefetch:
          data = data.prefetch(prefetch)
      # And 0 or None mean no prefetching.
  
      return data
  
imports: import collections
  import dataclasses
  import functools
  import itertools
  from typing import Any, Callable, Dict, Iterator, Optional, Sequence, Union
  from absl import logging
  from flax.training import common_utils
  import jax
  import jax.numpy
  import numpy
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 17 for calling a global function with example usage: make_pipeline(data, preprocess_fn, batch_size, drop_remainder, cache, repeats, repeat_after_batching, shuffle_buffer_size, prefetch, ignore_errors, dataset_service_address) and returns: data