code: def test_get_neighbor_indices(self):
      worlds, num_entities = self.get_fake_worlds()
      tensor = torch.LongTensor([])
  
      neighbor_indices = self.model._get_neighbor_indices(
          worlds, num_entities, tensor
      )
  
      # Checks for the correct shape meaning dimension 2 has size num_neighbors,
      # padding of -1 is used, and correct neighbor indices.
      assert_almost_equal(
          neighbor_indices.data.numpy(),
          [
              [[-1, -1], [3, 4], [3, 4], [1, 2], [1, 2]],
              [[-1, -1], [2, -1], [1, -1], [-1, -1], [-1, -1]],
          ],
      )
  
imports: from __future__ import division
  from __future__ import absolute_import
  from collections import namedtuple
  import os
  import pytest
  from flaky import flaky
  from numpy.testing import assert_almost_equal
  import torch
  from allennlp.common import Params
  from allennlp.common.testing import ModelTestCase
  from allennlp.models import Model, WikiTablesMmlSemanticParser
  from allennlp.training.metrics.wikitables_accuracy import SEMPRE_ABBREVIATIONS_PATH, SEMPRE_GRAMMAR_PATH
label_desc: Use image node_id 6 for calling the WikiTablesMmlSemanticParserTest obj's underlying member method code with example usage: obj.test_get_neighbor_indices() without return types