code: def get_vocab_and_both_elmo_indexed_ids(batch: List[List[str]]):
      instances = []
      indexer = ELMoTokenCharactersIndexer()
      indexer2 = SingleIdTokenIndexer()
      for sentence in batch:
          tokens = [Token(token) for token in sentence]
          field = TextField(
              tokens, {"character_ids": indexer, "tokens": indexer2}
          )
          instance = Instance({"elmo": field})
          instances.append(instance)
  
      dataset = Batch(instances)
      vocab = Vocabulary.from_instances(instances)
      dataset.index_instances(vocab)
      return vocab, dataset.as_tensor_dict()["elmo"]
  
imports: import json
  import os
  import warnings
  from typing import List
  import numpy
  import torch
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Instance, Token, Vocabulary
  from allennlp.data.batch import Batch
  from allennlp.data.fields import TextField
  from allennlp.data.token_indexers.elmo_indexer import ELMoTokenCharactersIndexer
  from allennlp.data.token_indexers.single_id_token_indexer import SingleIdTokenIndexer
  from allennlp.data.data_loaders import SimpleDataLoader
  from allennlp.modules.elmo import _ElmoBiLm, _ElmoCharacterEncoder, Elmo
  from allennlp.modules.token_embedders import ElmoTokenEmbedder
  from allennlp.nn.util import remove_sentence_boundaries
label_desc: Use image node_id 3 for calling the ElmoTestCase obj's underlying member method code with example usage: obj.get_vocab_and_both_elmo_indexed_ids(batch) and returns: vocab,  dataset