code: def _testOneHot(
      self,
      truth,
      use_gpu=False,
      expected_err_re=None,
      raises=None,
      dtype=None,
      **inputs,
  ):
      with self.cached_session(use_gpu=use_gpu):
          if raises is not None:
              with self.assertRaises(raises):
                  array_ops.one_hot(dtype=dtype, **inputs)
          else:
              ans = array_ops.one_hot(dtype=dtype, **inputs)
              if expected_err_re is None:
                  tf_ans = self.evaluate(ans)
                  self.assertAllEqual(tf_ans, truth)
                  if dtype:
                      self.assertEqual(tf_ans.dtype, dtype)
                  self.assertEqual(tf_ans.shape, ans.get_shape())
              else:
                  with self.assertRaisesOpError(expected_err_re):
                      self.evaluate(ans)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the OneHotTest obj's underlying member method code with example usage: obj._testOneHot(truth, use_gpu, expected_err_re, raises, dtype) without return types