code: def extract_dictionary_from_elasticsearch(data):
      dict_data = {}
      for item in data:
          headword = item["_id"]
          sense_data = item["_source"]["senses"]
          dict_data[headword] = sense_data
      return dict_data
  
imports: from elasticsearch import Elasticsearch
  from apps.directory.utils import DICTIONARY_FILE
  import yaml
label_desc: Use image node_id 2 for calling a global function with example usage: extract_dictionary_from_elasticsearch(data) and returns: dict_data