code: def test_checked_cast_with_error_override(self) -> None:
      self.assertEqual(checked_cast(float, 2.0), 2.0)
      with self.assertRaises(NotImplementedError):
          checked_cast(
              float,
              2,
              exception=NotImplementedError(
                  "foo() doesn't support ints"
              ),
          )
  
file_path: Ax/ax/utils/common/tests/test_typeutils.py
imports: import numpy
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast, checked_cast_dict, checked_cast_list, checked_cast_optional, not_none, numpy_type_to_python_type
label_desc: Use image node_id 3 for calling the TestTypeUtils obj's underlying member method code with example usage: obj.test_checked_cast_with_error_override() without return types