def is_variable_in_dataset(ds, var_id):
    """
    Checks that variable with name `var_id` exists in the file.
    Returns True if variable is in the dataset.

    :param ds: netCDF4 Dataset object
    :paran var_id: the variable ID.
    :return: boolean
    """
    return var_id in ds.variables