code: def testResultTypeSafeModeUnallowedPromo(self, a_dtype, b_dtype):
      with DtypeConversionTestEnv("safe"):
          # Create Tensor of input dtypes.
          input_a = (
              constant_op.constant(1, dtype=a_dtype[0])
              if a_dtype[0] != dtypes.bool
              else constant_op.constant(True)
          )
          input_b = (
              constant_op.constant(2, dtype=b_dtype[0])
              if b_dtype[0] != dtypes.bool
              else constant_op.constant(False)
          )
          # Create WeakTensors if weak = True.
          if a_dtype[1]:
              input_a = weak_tensor.WeakTensor(input_a)
          if b_dtype[1]:
              input_b = weak_tensor.WeakTensor(input_b)
  
          with self.assertRaises(TypeError):
              flexible_dtypes.result_type(input_a, input_b)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import extension_type
  from tensorflow.python.framework import flexible_dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import weak_tensor
  from tensorflow.python.ops import variables
  from tensorflow.python.ops import weak_tensor_test_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the DtypesUtilTest obj's underlying member method code with example usage: obj.testResultTypeSafeModeUnallowedPromo(a_dtype, b_dtype) without return types