code: def test_register_box(self):
      # test usage of decorator
      @register_box("A")
      class A(ToyBaseBoxes):
          pass
  
      # test usage of normal function
      class B(ToyBaseBoxes):
          pass
  
      register_box("B", B)
  
      # register class without inheriting from BaseBoxes
      with self.assertRaises(AssertionError):
  
          @register_box("C")
          class C:
              pass
  
      # test register registered class
      with self.assertRaises(KeyError):
  
          @register_box("A")
          class AA(ToyBaseBoxes):
              pass
  
      with self.assertRaises(KeyError):
          register_box("BB", B)
  
      @register_box("A", force=True)
      class AAA(ToyBaseBoxes):
          pass
  
      self.assertIs(box_types["a"], AAA)
      self.assertEqual(_box_type_to_name[AAA], "a")
      register_box("BB", B, force=True)
      self.assertIs(box_types["bb"], B)
      self.assertEqual(_box_type_to_name[B], "bb")
      self.assertEqual(len(box_types), len(_box_type_to_name))
  
file_path: mmdetection/tests/test_structures/test_bbox/test_box_type.py
imports: from unittest import TestCase
  from unittest.mock import MagicMock
  import torch
  from mmdet.structures.bbox.box_type import _box_type_to_name, box_converters, box_types, convert_box_type, get_box_type, register_box, register_box_converter
  from .utils import ToyBaseBoxes
label_desc: Use image node_id 3 for calling the TestBoxType obj's underlying member method code with example usage: obj.test_register_box() without return types