code: def test_QualityFocalLoss_Loss(loss_class, activated):
      input_shape = (4, 5)
      pred = torch.rand(input_shape)
      label = torch.Tensor([0, 1, 2, 0]).long()
      quality_label = torch.rand(input_shape[0])
  
      original_loss = loss_class(activated=activated)(
          pred, (label, quality_label)
      )
      assert isinstance(original_loss, torch.Tensor)
  
      target = torch.nn.functional.one_hot(label, 5)
      target = target * quality_label.reshape(input_shape[0], 1)
  
      new_loss = loss_class(activated=activated)(pred, target)
      assert isinstance(new_loss, torch.Tensor)
      assert new_loss == original_loss
  
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 3 for calling a global function with example usage: test_QualityFocalLoss_Loss(loss_class, activated) without return types