code: def make_coco_transforms(image_set, max_size=1333):
      """Returns a preprocessing function that operates on inputs and labels."""
      scales = [480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800]
      ratio = max_size / 1333.0
  
      scales = [int(s * ratio) for s in scales]
      scales2 = [int(s * ratio) for s in [400, 500, 600]]
  
      normalize_boxes = transforms.NormalizeBoxes()
      normalize_image = ImageNetNormalization()
      init_padding_mask = transforms.InitPaddingMask()
  
      if image_set == "train":
          return transforms.Compose(
              [
                  transforms.RandomHorizontalFlip(),
                  transforms.RandomSelect(
                      transforms.RandomResize(
                          scales, max_size=max_size
                      ),
                      transforms.Compose(
                          [
                              transforms.RandomResize(scales2),
                              transforms.RandomSizeCrop(
                                  int(ratio * 384), int(ratio * 600)
                              ),
                              transforms.RandomResize(
                                  scales, max_size=max_size
                              ),
                          ]
                      ),
                  ),
                  normalize_boxes,
                  normalize_image,
                  init_padding_mask,
              ]
          )
  
      elif image_set == "validation":
          return transforms.Compose(
              [
                  transforms.Resize(max(scales), max_size=max_size),
                  normalize_boxes,
                  normalize_image,
                  init_padding_mask,
              ]
          )
  
      else:
          raise ValueError(f"Unknown image_set: {image_set}")
  
imports: import functools
  from typing import Any, Callable, Mapping, Optional
  from absl import logging
  from flax import jax_utils
  import jax
  import jax.numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  from scenic.dataset_lib.coco_dataset import coco_utils
  from scenic.projects.baselines.detr import transforms
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 1 for calling a global function with example usage: make_coco_transforms(image_set, max_size) and returns: transforms, transforms