code: def read_corpus(file_name):
      """
      Read and return the data from a corpus json file.
      """
      try:
          import yaml
      except ImportError:
          message = (
              'Unable to import "yaml".\n'
              'Please install "pyyaml" to enable chatterbot corpus functionality:\n'
              "pip3 install pyyaml"
          )
          raise OptionalDependencyImportError(message)
  
      with io.open(file_name, encoding="utf-8") as data_file:
          return yaml.safe_load(data_file)
  
file_path: ChatterBot/chatterbot/corpus.py
imports: import os
  import io
  import glob
  from pathlib import Path
  from chatterbot.exceptions import OptionalDependencyImportError
label_desc: Use image node_id 2 for calling a global function with example usage: read_corpus(file_name) and returns: yaml