code: def transform_box(
      boxes: tf.Tensor,
      height: int,
      width: int,
      state: builders.ProcessorState,
  ) -> tf.Tensor:
      """Transform boxes given the state of image crop."""
      assert (
          state
          and "crop_offset_abs" in state
          and "crop_ori_shape" in state
      )
      offset = state["crop_offset_abs"]
      ori_shape = tf.cast(state["crop_ori_shape"], tf.float32)
      pixel_offset = tf.reshape(
          tf.stack([offset[2], offset[1], offset[2], offset[1]]),
          (1, 1, 4),
      )
      ori_size = tf.stack(
          [ori_shape[2], ori_shape[1], ori_shape[2], ori_shape[1]]
      )
      ori_size = tf.reshape(ori_size, (1, 1, 4))
      ori_boxes = boxes * tf.cast(ori_size, tf.float32)
      crop_boxes = ori_boxes - tf.cast(pixel_offset, tf.float32)
      new_shape = tf.constant(
          [width, height, width, height],
          dtype=tf.float32,
          shape=[1, 1, 4],
      )
      out_boxes = crop_boxes / new_shape
      return out_boxes
  
imports: from typing import Optional, Union
  from absl import logging
  from dmvr import builders
  from dmvr import processors
  import ml_collections
  import tensorflow
label_desc: Use image node_id 7 for calling a global function with example usage: transform_box(boxes, height, width, state) and returns: out_boxes