code: def test_create_beartype_decorator_errors_when_errors(self, arg):
      import beartype
  
      decorator = _beartype._create_beartype_decorator(
          _beartype.RuntimeTypeCheckState.ERRORS,
      )
      decorated = decorator(func_with_incorrect_type_hint)
      with self.assertRaises(beartype.roar.BeartypeCallHintViolation):
          decorated(arg)
  
file_path: pytorch/test/onnx/internal/test_beartype.py
imports: import unittest
  from torch.onnx._internal import _beartype
  from torch.testing._internal import common_utils
label_desc: Use image node_id 3 for calling the TestBeartype obj's underlying member method code with example usage: obj.test_create_beartype_decorator_errors_when_errors(arg) without return types