code: def test_bucket_values(self):
      indices = torch.LongTensor([1, 2, 7, 1, 56, 900])
      bucketed_distances = util.bucket_values(indices)
      numpy.testing.assert_array_equal(
          bucketed_distances.numpy(), numpy.array([1, 2, 5, 1, 8, 9])
      )
  
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 30 for calling the TestNnUtil obj's underlying member method code with example usage: obj.test_bucket_values() without return types