class_docstr: Tests for Numpy indexing translation rules.
class_docstr_tok: ["Tests","for","Numpy","indexing","translation","rules","."]
code: def testMixedAdvancedIntegerIndexing(
      self, name, shape, dtype, rng_factory, indexer
  ):
      rng = rng_factory()
      indexer_with_dummies = [
          e if isinstance(e, onp.ndarray) else () for e in indexer
      ]
      substitutes = [
          (i, e)
          for i, e in enumerate(indexer)
          if not isinstance(e, onp.ndarray)
      ]
      args_maker = lambda: [rng(shape, dtype), indexer_with_dummies]
  
      def np_fun(x, indexer_with_dummies):
          idx = type(indexer)(
              subvals(indexer_with_dummies, substitutes)
          )
          return x[idx]
  
      jnp_fun = lambda x, idx: np_fun(tnp.asarray(x), idx)
  
      self._CheckAgainstNumpy(
          np_fun, jnp_fun, args_maker, check_dtypes=True
      )
      # TODO(wangpeng): check_xla_forced_compile is turned off for
      # IntArrayWithInt32Type because it throws "The number of output elements has
      # to equal to number of input elements that are sliced when input indices
      # are not constant". Investigate and turn it on.
      check_xla = name != "IntArrayWithInt32Type"
      self._CompileAndCheck(
          jnp_fun,
          args_maker,
          check_dtypes=True,
          check_incomplete_shape=True,
          check_xla_forced_compile=check_xla,
      )
  
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 6 for calling the IndexingTest obj's underlying member method code with example usage: obj.testMixedAdvancedIntegerIndexing(name, shape, dtype, rng_factory, indexer) and returns: x