code: def _load_yaml(self, config_file):
          
          try:
              with open(config_file) as f:
                  return yaml.safe_load(f.read())
          except yaml.YAMLError as exc:
              logger.error("Could not parse config as YAML: {}", str(exc))
              if hasattr(exc, 'problem_mark'):
                  mark = exc.problem_mark
                  logger.error("Error position: (%s:%s)" % (mark.line + 1, mark.column + 1))
          except IOError as e:
              logger.debug("Could not open config file: {}", str(e))
  
          return None
docs: Load config from yaml file or string
  
          :type config_file: str
          :rtype: dict
  
          :param config_file: config to load. Can be file path or yaml string
          :return: Loaded config