def METHOD_NAME(obj, **options):
    """
    Serialize Python data to YAML.
    :param obj: the data structure to serialize
    :param options: options given to lower yaml module.
    """
    options.setdefault("Dumper", Dumper)
    options.setdefault("default_flow_style", None)
    try:
        response = yaml.dump(obj, **options)
        if response.endswith("\n...\n"):
            return response[:-5]
        if response.endswith("\n"):
            return response[:-1]
        return response
    except Exception as error:  # pylint: disable=broad-except
        log.exception("Error encountered while serializing")
        raise SerializationError(error)