code: def testScalarIndexOutOfRange(self):
      # GPU kernels don't throw exceptions.
      with self.cached_session(use_gpu=False):
          bad = 17
          data = np.zeros(5)
          partitions = data_flow_ops.dynamic_partition(
              data, bad, num_partitions=7
          )
          with self.assertRaisesOpError(
              r"partitions = 17 is not in \[0, 7\)"
          ):
              self.evaluate(partitions)
  
imports: import unittest
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import data_flow_ops
  from tensorflow.python.ops import gradients_impl
  import tensorflow.python.ops.data_flow_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 15 for calling the DynamicPartitionTest obj's underlying member method code with example usage: obj.testScalarIndexOutOfRange() without return types