code: def test_elmo_empty_token_list(self):
      # Basic test
      indexer = ELMoTokenCharactersIndexer()
      assert {"elmo_tokens": []} == indexer.get_empty_token_list()
      # Real world test
      indexer = {"elmo": indexer}
      tokens_1 = TextField([Token("Apple")], indexer)
      targets_1 = ListField([TextField([Token("Apple")], indexer)])
      tokens_2 = TextField([Token("Screen"), Token("device")], indexer)
      targets_2 = ListField(
          [
              TextField([Token("Screen")], indexer),
              TextField([Token("Device")], indexer),
          ]
      )
      instance_1 = Instance({"tokens": tokens_1, "targets": targets_1})
      instance_2 = Instance({"tokens": tokens_2, "targets": targets_2})
      a_batch = Batch([instance_1, instance_2])
      a_batch.index_instances(Vocabulary())
      batch_tensor = a_batch.as_tensor_dict()
      elmo_target_token_indices = batch_tensor["targets"]["elmo"][
          "elmo_tokens"
      ]
      # The TextField that is empty should have been created using the
      # `get_empty_token_list` and then padded with zeros.
      empty_target = elmo_target_token_indices[0][1].numpy()
      np.testing.assert_array_equal(np.zeros((1, 50)), empty_target)
      non_empty_targets = [
          elmo_target_token_indices[0][0],
          elmo_target_token_indices[1][0],
          elmo_target_token_indices[1][1],
      ]
      for non_empty_target in non_empty_targets:
          with pytest.raises(AssertionError):
              np.testing.assert_array_equal(
                  np.zeros((1, 50)), non_empty_target
              )
  
file_path: allennlp/tests/data/token_indexers/elmo_indexer_test.py
imports: import numpy
  import pytest
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token, Vocabulary, Instance
  from allennlp.data.batch import Batch
  from allennlp.data.token_indexers import ELMoTokenCharactersIndexer
  from allennlp.data.fields import ListField, TextField
label_desc: Use image node_id 6 for calling the TestELMoTokenCharactersIndexer obj's underlying member method code with example usage: obj.test_elmo_empty_token_list() without return types