code: def prepare_testing_targets(self, batch_img_metas, device):
      # [-1, 0, 1, 2, ..., T-1] when sampling_timesteps == timesteps
      times = torch.linspace(
          -1, self.timesteps - 1, steps=self.sampling_timesteps + 1
      )
      times = list(reversed(times.int().tolist()))
      # [(T-1, T-2), (T-2, T-3), ..., (1, 0), (0, -1)]
      time_pairs = list(zip(times[:-1], times[1:]))
  
      noise_bboxes_list = []
      noise_bboxes_raw_list = []
      image_size_list = []
      for img_meta in batch_img_metas:
          h, w = img_meta["img_shape"]
          image_size = torch.tensor(
              [w, h, w, h], dtype=torch.float32, device=device
          )
          noise_bboxes_raw = torch.randn(
              (self.num_proposals, 4), device=device
          )
          noise_bboxes = torch.clamp(
              noise_bboxes_raw,
              min=-1 * self.snr_scale,
              max=self.snr_scale,
          )
          noise_bboxes = ((noise_bboxes / self.snr_scale) + 1) / 2
          noise_bboxes = bbox_cxcywh_to_xyxy(noise_bboxes)
          noise_bboxes = noise_bboxes * image_size
  
          noise_bboxes_raw_list.append(noise_bboxes_raw)
          noise_bboxes_list.append(noise_bboxes)
          image_size_list.append(image_size[None])
      batch_noise_bboxes = torch.stack(noise_bboxes_list)
      batch_image_size = torch.cat(image_size_list)
      batch_noise_bboxes_raw = torch.stack(noise_bboxes_raw_list)
      return (
          time_pairs,
          batch_noise_bboxes,
          batch_noise_bboxes_raw,
          batch_image_size,
      )
  
imports: import copy
  import math
  import random
  import warnings
  from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import build_activation_layer
  from mmcv.ops import batched_nms
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi, bbox_cxcywh_to_xyxy, bbox_xyxy_to_cxcywh, get_box_wh, scale_boxes
  from mmdet.utils import InstanceList
label_desc: Use image node_id 12 for calling the DynamicDiffusionDetHead obj's underlying member method code with example usage: obj.prepare_testing_targets(batch_img_metas, device) and returns: time_pairs,  batch_noise_bboxes,  batch_noise_bboxes_raw,  batch_image_size