code: def elmo_command(args):
      elmo_embedder = ElmoEmbedder(
          args.options_file, args.weight_file, args.cuda_device
      )
      output_format = ""
      if args.all:
          output_format = "all"
      elif args.top:
          output_format = "top"
      elif args.average:
          output_format = "average"
  
      prepare_global_logging(
          os.path.realpath(os.path.dirname(args.output_file)),
          args.file_friendly_logging,
      )
  
      with torch.no_grad():
          elmo_embedder.embed_file(
              args.input_file,
              args.output_file,
              output_format,
              args.batch_size,
              args.forget_sentences,
              args.use_sentence_keys,
          )
  
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 2 for calling a global function with example usage: elmo_command(args) without return types