code: def test_flatten_and_batch_shift_indices(self):
      indices = numpy.array(
          [
              [[1, 2, 3, 4], [5, 6, 7, 8], [9, 9, 9, 9]],
              [[2, 1, 0, 7], [7, 7, 2, 3], [0, 0, 4, 2]],
          ]
      )
      indices = torch.tensor(indices, dtype=torch.long)
      shifted_indices = util.flatten_and_batch_shift_indices(
          indices, 10
      )
      numpy.testing.assert_array_equal(
          shifted_indices.data.numpy(),
          numpy.array(
              [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  9,
                  9,
                  9,
                  12,
                  11,
                  10,
                  17,
                  17,
                  17,
                  12,
                  13,
                  10,
                  10,
                  14,
                  12,
              ]
          ),
      )
  
imports: from __future__ import with_statement
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_almost_equal
  import torch
  import pytest
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.nn import util
label_desc: Use image node_id 27 for calling the TestNnUtil obj's underlying member method code with example usage: obj.test_flatten_and_batch_shift_indices() without return types