code: def _get_loader(config):
      
      if config.endswith('.yml') or config.endswith('.yaml'):
          if not yaml:
              LOGGER.error("pyyaml must be installed to use the YAML loader")
              # TODO: stop reactor if running
              return None, None
          return 'yaml', yaml.load
      else:
          return 'json', json.loads
docs: Determine which config file type and loader to use based on a filename.
  
      :param config str: filename to config file
      :return: a tuple of the loader type and callable to load
      :rtype: (str, Callable)