code: def testFormatTensorWithEllipses(self):
      a = (
          (np.arange(11 * 11 * 11) + 1000)
          .reshape([11, 11, 11])
          .astype(np.int32)
      )
  
      out = tensor_format.format_tensor(
          a,
          "a",
          False,
          np_printoptions={"threshold": 100, "edgeitems": 2},
      )
  
      cli_test_utils.assert_lines_equal_ignoring_whitespace(
          self, ['Tensor "a":', ""], out.lines[:2]
      )
      self.assertEqual(repr(a).split("\n"), out.lines[2:])
  
      self._checkTensorMetadata(a, out.annotations)
  
      # Check annotations for beginning indices of the lines.
      actual_row_0_0_0, _ = self._findFirst(out.lines, "1000")
      self.assertEqual(
          {tensor_format.BEGIN_INDICES_KEY: [0, 0, 0]},
          out.annotations[actual_row_0_0_0],
      )
      actual_row_0_1_0, _ = self._findFirst(out.lines, "1011")
      self.assertEqual(
          {tensor_format.BEGIN_INDICES_KEY: [0, 1, 0]},
          out.annotations[actual_row_0_1_0],
      )
      # Find the first line that is completely omitted.
      omitted_line = 2
      while not out.lines[omitted_line].strip().startswith("..."):
          omitted_line += 1
      self.assertEqual(
          {tensor_format.OMITTED_INDICES_KEY: [0, 2, 0]},
          out.annotations[omitted_line],
      )
  
      actual_row_10_10_0, _ = self._findFirst(out.lines, "2320")
      self.assertEqual(
          {tensor_format.BEGIN_INDICES_KEY: [10, 10, 0]},
          out.annotations[actual_row_10_10_0],
      )
      # Find the last line that is completely omitted.
      omitted_line = len(out.lines) - 1
      while not out.lines[omitted_line].strip().startswith("..."):
          omitted_line -= 1
      self.assertEqual(
          {tensor_format.OMITTED_INDICES_KEY: [10, 2, 0]},
          out.annotations[omitted_line],
      )
  
imports: import re
  import numpy
  from tensorflow.core.framework import tensor_pb2
  from tensorflow.core.framework import tensor_shape_pb2
  from tensorflow.core.framework import types_pb2
  from tensorflow.python.debug.cli import cli_test_utils
  from tensorflow.python.debug.cli import tensor_format
  from tensorflow.python.debug.lib import debug_data
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 18 for calling the RichTextLinesTest obj's underlying member method code with example usage: obj.testFormatTensorWithEllipses() without return types