def normalize_date(date, **kwargs):
if date is None:<EOL><INDENT>return<EOL><DEDENT>return PartialDate.parse(date, **kwargs).dumps()<EOL>
Normalize a date to the be schema-compliant.

    This is a convenience wrapper around :ref:`PartialDate`, which should be
    used instead if more features are needed.

    Note:
        When ``date`` is ``None`` this returns ``None`` instead of raising
        an exception because this makes ``DoJSON``'s code simpler, as it
        already knows how to strip ``None`` values at the end.

    Args:
        date(str): date to normalize
        **kwargs: these are passed to the `dateutil.parser.parse` function
            that is used internally to parse the date. Most notably, the
            `yearfirst` and `datefirst` flags can be used if the ordering
            of the date parts is know.

    Returns:
        str: normalized date, in the form ``YYYY-MM-DD``, ``YYYY-MM`` or
            ``YYYY`` (depending on the information present in the date).

    Raises:
        ValueError: when the date cannot be parsed or no year is present.

    Examples:
        >>> normalize_date(None)
        >>> normalize_date('30 Jun 1686')
        '1686-06-30'