code: def test_reweight_loss_dict():
      weight = 4
      losses = {
          "cls_loss": torch.tensor(2.0),
          "reg_loss": torch.tensor(1.0),
      }
      weighted_losses = reweight_loss_dict(
          copy.deepcopy(losses), weight
      )
      for name in losses.keys():
          assert weighted_losses[name] == losses[name] * weight
  
file_path: mmdetection/tests/test_models/test_utils/test_misc.py
imports: import copy
  import pytest
  import torch
  from mmengine.structures import InstanceData
  from mmdet.models.utils import empty_instances, filter_gt_instances, rename_loss_dict, reweight_loss_dict, unpack_gt_instances
  from mmdet.testing import demo_mm_inputs
label_desc: Use image node_id 5 for calling a global function with example usage: test_reweight_loss_dict() without return types