code: def open_file(path, grib_errors='warn', **kwargs):
      
      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))
docs: Open a GRIB file as a ``cfgrib.Dataset``.