code: def get_handler(filename):
      _, extension = os.path.splitext(filename)
      if extension in yaml_extensions and not opt.has_yaml:
          raise KeyError(
              'Configuration file "{}" cannot be loaded as '
              "you do not have PyYAML installed.".format(filename)
          )
      try:
          return HANDLER_BY_EXT[extension]
      except KeyError as e:
          raise ValueError(
              'Configuration file "{}" has invalid or unsupported extension '
              '"{}".'.format(filename, extension)
          ) from e
  
file_path: sacred/sacred/config/config_files.py
imports: import os
  import pickle
  import json
  import sacred.optional
  from sacred.serializer import flatten, restore
label_desc: Use image node_id 1 for calling a global function with example usage: get_handler(filename) and returns: HANDLER_BY_EXT