def _revert(converter, result, converted=False, result_conversion=None,
    estimator=None, **converter_args):
    """
    Use the `converter` to convert the given `result` if necessary.

    sklearn toolkit produces all its results as numpy format by default.
    However here, as we need to convert inputs to H2OFrames,
    and as we may chain H2O transformers and estimators,
    then we apply some detection logic to return results in the same format as input by default.
    This can be overridden at decorator level for specific methods (e.g. transform)
    or at estimator level for other cases (predict on a pipeline with H2O transformers and numpy inputs).
    """
    estimator_conversion = getattr(estimator, 'data_conversion', None)
    do_convert = estimator_conversion is True or estimator_conversion in (None,
        'auto') and (result_conversion is True or result_conversion in (
        None, 'auto') and converted)
    return converter(result, estimator=estimator, **converter_args
        ) if do_convert else result
