class_docstr: Tests for Numpy indexing translation rules.
class_docstr_tok: ["Tests","for","Numpy","indexing","translation","rules","."]
code: def testFloatIndexingError(self):
      error_regex = "only integers, slices.*are valid indices"
      # Verify onp behavior
      with self.assertRaisesRegex(IndexError, error_regex):
          _ = onp.zeros((2, 2))[(0, 0.0)]
      # Test tnp
      with self.assertRaisesRegex(IndexError, error_regex):
          tnp.zeros(2)[0.0]  # pylint: disable=expression-not-assigned
      with self.assertRaisesRegex(IndexError, error_regex):
          tnp.zeros((2, 2))[
              (0, 0.0)
          ]  # pylint: disable=expression-not-assigned
      # Test with jit
      with self.assertRaisesRegex(IndexError, error_regex):
          nje.jit(lambda idx: tnp.zeros((2, 2))[idx])((0, 0.0))
  
imports: import collections
  import enum
  from functools import partial
  import itertools
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import config
  from tensorflow.python.ops.numpy_ops.tests.config import config
  import tensorflow.python.ops.numpy_ops.tests.extensions
  import tensorflow.python.ops.numpy_ops.tests.np_wrapper
  import tensorflow.python.ops.numpy_ops.tests.test_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 18 for calling the IndexingTest obj's underlying member method code with example usage: obj.testFloatIndexingError() without return types