code: def test_truncate_to_length_questionable_behavior(self):
      # Use of np.reshape in TruncateToLength allows non-truncation results
      # without warning. As long as the target shape (len_map value) is
      # lexicographically prior to the data shape, then np.reshape can happen,
      # even if it results in *adding* values to the overall array.
      #
      # This test passes as a marker of the questionable behavior, and should
      # *fail* -- and then be removed -- when the function is
      # clarified/re-implemented.
      #
      # TODO(jonni): Determine desired behavior, and fit implementation to it.
      x = np.arange(21).reshape((1, 21, 1))
  
      def data_stream():
          while True:
              yield x
  
      stream_fn = data.inputs.TruncateToLength(len_map={0: (1, 4, 6)})
      (y,) = next(stream_fn(data_stream()))
      self.assertEqual(y.shape, (1, 4, 6))
      self.assertEqual(y[0, 3, 1], 19)
      self.assertEqual(y[0, 3, 2], 20)  # end of original values [0..20]
      self.assertEqual(y[0, 3, 3], 0)  # added value
      self.assertEqual(y[0, 3, 4], 1)  # added value
      self.assertEqual(y[0, 3, 5], 2)
  
imports: import itertools
  import os
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from trax import data
label_desc: Use image node_id 26 for calling the InputsTest obj's underlying member method code with example usage: obj.test_truncate_to_length_questionable_behavior() without return types