def METHOD_NAME(self, name):
    """Return contents of yaml file as dict"""
    # For DAT-1064 Bomb out hard if unicode is in a schema file
    # But allow unicode through the terms and definitions
    with open(name) as f:
        if name not in self.exclude:
            try:
                f.read().encode("ascii")
                f.seek(0)
            except Exception as e:
                self.logger.error(f"Error in file: {name}")
                raise e
        if yaml.__with_libyaml__:
            return yaml.load(f, Loader=yaml.CSafeLoader)
        self.logger.debug("To enable CSafeLoader install libyaml. Falling back to yaml.safe_load()")
        return yaml.safe_load(f)