def regrid_get_operator_method(operator, method):
    """Return the regridding method of a regridding operator.

    :Parameters:

        operator: `RegridOperator`
            The regridding operator.

        method: `str` or `None`
            A regridding method. If `None` then ignored. If a `str`
            then an exception is raised if it not equivalent to the
            regridding operator's method.

    :Returns:

        `string`
            The operator's regridding method.

    """
    if method is None:
        method = operator.method
    elif not operator.check_method(method):
        raise ValueError(
            f"Method {method!r} does not match the method of the "
            f"regridding operator: {operator.method!r}"
        )

    return method