code: def test_batch_tensors_does_not_modify_list(self):
      field = ProductionRuleField("S -> [NP, VP]", is_global_rule=True)
      field.index(self.vocab)
      padding_lengths = field.get_padding_lengths()
      tensor_dict1 = field.as_tensor(padding_lengths)
  
      field = ProductionRuleField("NP -> test", is_global_rule=True)
      field.index(self.vocab)
      padding_lengths = field.get_padding_lengths()
      tensor_dict2 = field.as_tensor(padding_lengths)
      tensor_list = [tensor_dict1, tensor_dict2]
      assert field.batch_tensors(tensor_list) == tensor_list
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/fields/production_rule_field_test.py
imports: from __future__ import absolute_import
  from collections import defaultdict
  from numpy.testing import assert_almost_equal
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Vocabulary
  from allennlp.data.fields import ListField, ProductionRuleField
label_desc: Use image node_id 6 for calling the TestProductionRuleField obj's underlying member method code with example usage: obj.test_batch_tensors_does_not_modify_list() without return types