code: def elmo_dump():
      out_file = args.output
      mention_files = list()
      if os.path.isdir(args.mentions):
          for dirpath, _, files in os.walk(args.mentions):
              for file in files:
                  if file == ".DS_Store":
                      continue
  
                  mention_files.append(join(dirpath, file))
      else:
          mention_files.append(args.mentions)
  
      mentions = []
      for _file in mention_files:
          mentions.extend(
              MentionData.read_mentions_json_to_mentions_data_list(
                  _file
              )
          )
  
      elmo_ecb_embeddings = load_elmo_for_vocab(mentions)
  
      with open(out_file, "wb") as f:
          pickle.dump(elmo_ecb_embeddings, f)
  
      logger.info("Saving dump to file-%s", out_file)
  
file_path: nlp-architect/nlp_architect/data/cdc_resources/gen_scripts/create_word_embed_elmo_dump.py
imports: import argparse
  import logging
  import os
  import pickle
  from os.path import join
  from nlp_architect.common.cdc.mention_data import MentionData
  from nlp_architect.data.cdc_resources.embedding.embed_elmo import ElmoEmbedding
  from nlp_architect.utils import io
label_desc: Use image node_id 2 for calling a global function with example usage: elmo_dump() without return types