def __datetime_representer(dumper, data):
    """
    Ensures that datetime objects are represented correctly.
    """
    value = data.isoformat("T")
    return dumper.represent_scalar("tag:yaml.org,2002:timestamp", value)