class_docstr: Note that ELMo maintains an internal state dependent on previous batches.
  As a result, ELMo will return differing results if the same sentence is
  passed to the same ``Elmo`` instance multiple times.
  
  See https://github.com/allenai/allennlp/blob/master/tutorials/how_to/elmo.md for more details.
code: def add_subparser(self, name, parser):
      # pylint: disable=protected-access
      description = """Create word vectors using ELMo."""
      subparser = parser.add_parser(
          name,
          description=description,
          help="Use a trained model to make predictions.",
      )
  
      subparser.add_argument(
          "input_file",
          type=argparse.FileType("r"),
          help="The path to the input file.",
      )
      subparser.add_argument(
          "output_file",
          type=unicode,
          help="The path to the output file.",
      )
  
      group = subparser.add_mutually_exclusive_group(required=True)
      group.add_argument(
          "--all",
          action="store_true",
          help="Output all three ELMo vectors.",
      )
      group.add_argument(
          "--top",
          action="store_true",
          help="Output the top ELMo vector.",
      )
      group.add_argument(
          "--average",
          action="store_true",
          help="Output the average of the ELMo vectors.",
      )
  
      subparser.add_argument(
          "--vocab-path",
          type=unicode,
          help="A path to a vocabulary file to generate.",
      )
      subparser.add_argument(
          "--options-file",
          type=unicode,
          default=DEFAULT_OPTIONS_FILE,
          help="The path to the ELMo options file.",
      )
      subparser.add_argument(
          "--weight-file",
          type=unicode,
          default=DEFAULT_WEIGHT_FILE,
          help="The path to the ELMo weight file.",
      )
      subparser.add_argument(
          "--batch-size",
          type=int,
          default=DEFAULT_BATCH_SIZE,
          help="The batch size to use.",
      )
      subparser.add_argument(
          "--file-friendly-logging",
          default=False,
          action="store_true",
          help="outputs tqdm status on separate lines and slows tqdm refresh rate.",
      )
      subparser.add_argument(
          "--cuda-device",
          type=int,
          default=-1,
          help="The cuda_device to run on.",
      )
      subparser.add_argument(
          "--forget-sentences",
          action="store_true",
          help="If this flag is specified, and --use-sentence-keys is "
          "not, remove the string serialized JSON dictionary "
          "that associates sentences with their line number (its "
          "HDF5 key) that is normally placed in the "
          '"sentence_to_index" HDF5 key.',
      )
      subparser.add_argument(
          "--use-sentence-keys",
          action="store_true",
          help="Normally a sentence's line number is used as the "
          "HDF5 key for its embedding. If this flag is specified, "
          "the sentence itself will be used as the key.",
      )
  
      subparser.set_defaults(func=elmo_command)
  
      return subparser
  
imports: from __future__ import with_statement
  from __future__ import absolute_import
  import argparse
  import json
  import logging
  import os
  import warnings
  import numpy
  import torch
  from allennlp.common.tqdm import Tqdm
  from allennlp.common.util import lazy_groups_of, prepare_global_logging
  from allennlp.common.checks import ConfigurationError
  from allennlp.data.token_indexers.elmo_indexer import ELMoTokenCharactersIndexer
  from allennlp.nn.util import remove_sentence_boundaries
  from allennlp.modules.elmo import _ElmoBiLm, batch_to_ids
  from allennlp.commands.subcommand import Subcommand
label_desc: Use image node_id 1 for calling the Elmo obj's underlying member method code with example usage: obj.add_subparser(name, parser) and returns: subparser