def open_file(path, grib_errors='warn', **kwargs):
    """Open a GRIB file as a ``cfgrib.Dataset``."""
    if 'mode' in kwargs:
        warnings.warn("the `mode` keyword argument is ignored and deprecated", FutureWarning)
        kwargs.pop('mode')
    stream = messages.FileStream(path, message_class=cfmessage.CfMessage, errors=grib_errors)
    return Dataset(*build_dataset_components(stream, **kwargs))
Open a GRIB file as a ``cfgrib.Dataset``.