code: def _crop_and_resize_image(
      image,
      original_bbox,
      height,
      width,
      deterministic=False,
      random_crop=False,
  ):
      with tf.name_scope("random_crop_and_resize"):
          eval_crop_ratio = 0.8
          if random_crop:
              (
                  bbox_begin,
                  bbox_size,
                  bbox,
              ) = tf.image.sample_distorted_bounding_box(
                  tf.shape(image),
                  bounding_boxes=tf.zeros(
                      shape=[1, 0, 4]
                  ),  # No bounding boxes
                  min_object_covered=0.1,
                  aspect_ratio_range=[0.8, 1.25],
                  area_range=[0.1, 1.0],
                  max_attempts=100,
                  seed=7 * (1 + hvd.rank()) if deterministic else 0,
                  use_image_if_no_bounding_boxes=True,
              )
              image = tf.slice(image, bbox_begin, bbox_size)
          else:
              # Central crop
              image = tf.image.central_crop(image, eval_crop_ratio)
          image = tf.compat.v1.image.resize_images(
              image,
              [height, width],
              tf.image.ResizeMethod.BILINEAR,
              align_corners=False,
          )
          image.set_shape([height, width, 3])
          return image
  
imports: import tensorflow
  import sys
  import os
  import numpy
  from subprocess import call
  import horovod.tensorflow.keras
  from nvidia.dali.pipeline import pipeline_def
  import nvidia.dali.fn
  import nvidia.dali.types
  import nvidia.dali.tfrecord
label_desc: Use image node_id 3 for calling a global function with example usage: _crop_and_resize_image(image, original_bbox, height, width, deterministic, random_crop) and returns: image