code: def _targets_from_batch(
      batch: ArrayDict, target_is_onehot: bool = False
  ) -> Tuple[jnp.ndarray, jnp.ndarray]:
      """Get target labels and boxes with additional non-object appended."""
      # Append the no-object class label so we are always guaranteed one.
      tgt_labels = batch["label"]["labels"]
      tgt_boxes = batch["label"]["boxes"]
  
      # Append a class label.
      if target_is_onehot:
          # Shape is [batch, num_instances, num_classes]
          label_shape = tgt_labels.shape
          num_classes = label_shape[-1]
          instance = jax.nn.one_hot(0, num_classes)
          reshape_shape = (1,) * (len(label_shape) - 1) + (num_classes,)
          broadcast_shape = label_shape[:-2] + (1, num_classes)
          instance = jnp.broadcast_to(
              jnp.reshape(instance, reshape_shape), broadcast_shape
          )
      else:
          instance = jnp.zeros_like(tgt_labels[..., :1])
      tgt_labels = jnp.concatenate([tgt_labels, instance], axis=1)
  
      # Same for boxes.
      instance = jnp.zeros_like(tgt_boxes[..., :1, :])
      tgt_boxes = jnp.concatenate([tgt_boxes, instance], axis=1)
      return tgt_labels, tgt_boxes
  
imports: import math
  from typing import Any, Dict, Optional, Sequence, Tuple, Union
  from absl import logging
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib import matchers
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import box_utils
  from scenic.model_lib.base_models import model_utils
  from scenic.projects.baselines.deformable_detr.backbone import DeformableDETRBackbone
  from scenic.projects.baselines.deformable_detr.backbone import InputPosEmbeddingSine
  from scenic.projects.baselines.deformable_detr.backbone import mask_for_shape
  from scenic.projects.baselines.deformable_detr.deformable_transformer import BBoxCoordPredictor
  from scenic.projects.baselines.deformable_detr.deformable_transformer import DeformableDETRTransformer
  from scenic.projects.baselines.deformable_detr.deformable_transformer import inverse_sigmoid
  from scenic.projects.baselines.deformable_detr.deformable_transformer import pytorch_kernel_init
label_desc: Use image node_id 4 for calling a global function with example usage: _targets_from_batch(batch, target_is_onehot) and returns: tgt_labels,  tgt_boxes