<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query_variable(ncfile, name) -> netcdf4.Variable: """Return the variable with the given name from the given NetCDF file. Essentially, |query_variable| just performs a key assess via the used NetCDF library, but adds information to possible error messages: Traceback (most recent call last):
 OSError: NetCDF file `model.nc` does not contain variable `flux_prec`. True """

    try:
        return ncfile[name]
    except (IndexError, KeyError):
        raise OSError(
            'NetCDF file `%s` does not contain variable `%s`.'
            % (get_filepath(ncfile), name))