code: def test_ddq_aux_loss(loss_class):
      data_sample_file_path = "tests/data/coco_batched_sample.json"
      num_classes = 80
      num_pred = 1350
  
      with open(data_sample_file_path, "r") as file_stream:
          data_sample_infos = json.load(file_stream)
  
      gt_bboxes = []
      img_metas = []
      gt_labels = []
  
      for data_sample_info in data_sample_infos:
          metainfo = data_sample_info["metainfo"]
          labels = torch.LongTensor(data_sample_info["labels"])
          bboxes = torch.Tensor(data_sample_info["bboxes"])
  
          img_metas.append(metainfo)
          gt_labels.append(labels)
          gt_bboxes.append(bboxes)
  
      batch_size = len(data_sample_infos)
      pred_classes = torch.rand([batch_size, num_pred, num_classes])
      pred_bboxes = torch.rand([batch_size, num_pred, 4])
  
      aux_loss_for_dense = loss_class(
          train_cfg=dict(
              assigner=dict(type="TopkHungarianAssigner", topk=4)
          )
      )
  
      aux_loss = aux_loss_for_dense.loss(
          pred_classes, pred_bboxes, gt_bboxes, gt_labels, img_metas
      )
  
      assert isinstance(aux_loss, dict)
  
      for loss_name, batch_losses in aux_loss.items():
          assert isinstance(batch_losses, list)
  
          for loss in batch_losses:
              assert isinstance(loss, torch.Tensor)
  
file_path: mmdetection/tests/test_models/test_losses/test_loss.py
imports: import json
  import pytest
  import torch
  import torch.nn.functional
  from mmengine.utils import digit_version
  from mmdet.models.losses import BalancedL1Loss, CrossEntropyLoss, DDQAuxLoss, DiceLoss, DistributionFocalLoss, EQLV2Loss, FocalLoss, GaussianFocalLoss, KnowledgeDistillationKLDivLoss, L1Loss, MarginL2Loss, MSELoss, QualityFocalLoss, SeesawLoss, SmoothL1Loss, VarifocalLoss
  from mmdet.models.losses.ghm_loss import GHMC, GHMR
  from mmdet.models.losses.iou_loss import BoundedIoULoss, CIoULoss, DIoULoss, EIoULoss, GIoULoss, IoULoss, SIoULoss
label_desc: Use image node_id 11 for calling a global function with example usage: test_ddq_aux_loss(loss_class) without return types