code: def testDocStringExamples(self):
      # Sliding window (width=3) across a sequence of tokens
      data = constant_op.constant(
          ["one", "two", "three", "four", "five", "six"]
      )
      output = sliding_window_op.sliding_window(
          data=data, width=3, axis=0
      )
      self.assertAllEqual(
          output,
          [
              [b"one", b"two", b"three"],
              [b"two", b"three", b"four"],
              [b"three", b"four", b"five"],
              [b"four", b"five", b"six"],
          ],
      )
      self.assertEqual(
          "Shape: %s -> %s" % (data.shape, output.shape),
          "Shape: (6,) -> (4, 3)",
      )
  
      # Sliding window (width=2) across the inner dimension of a ragged matrix
      # containing a batch of token sequences
      data = ragged_factory_ops.constant(
          [
              ["Up", "high", "in", "the", "air"],
              ["Down", "under", "water"],
              ["Away", "to", "outer", "space"],
          ]
      )
      output = sliding_window_op.sliding_window(data, width=2, axis=-1)
      self.assertAllEqual(
          output,
          [
              [
                  [b"Up", b"high"],
                  [b"high", b"in"],
                  [b"in", b"the"],
                  [b"the", b"air"],
              ],
              [[b"Down", b"under"], [b"under", b"water"]],
              [
                  [b"Away", b"to"],
                  [b"to", b"outer"],
                  [b"outer", b"space"],
              ],
          ],
      )  # pyformat: disable
      self.assertEqual(
          "Shape: %s -> %s"
          % (data.shape.as_list(), output.shape.as_list()),
          "Shape: [3, None] -> [3, None, 2]",
      )
  
      # Sliding window across the second dimension of a 3-D tensor containing
      # batches of sequences of embedding vectors:
      data = constant_op.constant(
          [
              [[1, 1, 1], [2, 2, 1], [3, 3, 1], [4, 4, 1], [5, 5, 1]],
              [[1, 1, 2], [2, 2, 2], [3, 3, 2], [4, 4, 2], [5, 5, 2]],
          ]
      )
      output = sliding_window_op.sliding_window(
          data=data, width=2, axis=1
      )
      self.assertAllEqual(
          output,
          [
              [
                  [[1, 1, 1], [2, 2, 1]],
                  [[2, 2, 1], [3, 3, 1]],
                  [[3, 3, 1], [4, 4, 1]],
                  [[4, 4, 1], [5, 5, 1]],
              ],
              [
                  [[1, 1, 2], [2, 2, 2]],
                  [[2, 2, 2], [3, 3, 2]],
                  [[3, 3, 2], [4, 4, 2]],
                  [[4, 4, 2], [5, 5, 2]],
              ],
          ],
      )
      self.assertEqual(
          "Shape: %s -> %s" % (data.shape, output.shape),
          "Shape: (2, 5, 3) -> (2, 4, 2, 3)",
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.platform import test
  from tensorflow_text.python.ops import sliding_window_op
label_desc: Use image node_id 1 for calling the SlidingWindowOpTest obj's underlying member method code with example usage: obj.testDocStringExamples() without return types