def _mu(df, formula, temp, cas, full):
    """
    Helper for the `mu_gas` function to determine gas viscosity.

    Parameters
    ----------
    df : dataframe
        Dataframe from inorganic or organic data
    formula : str
        Molecular formula for the gas
    temp : float
        Gas temperature
    cas : str
        CAS number
    full : bool
        Flag to print more information

    Returns
    -------
    mu_gas : float
        Viscosity of gas [micropoise]
    mu_gas, cas, tmin, tmax, a, b, c, d : tuple
        Additional values returned only if full=True.
    """
    if cas:
        df = df[df['CAS No.'] == str(cas)]
    cas = df.loc[formula]['CAS No.']
    tmin = df.loc[formula]['temperature, Tmin (K)']
    tmax = df.loc[formula]['temperature, Tmax (K)']
    a = df.loc[formula]['A']
    b = df.loc[formula]['B']
    c = df.loc[formula]['C']
    d = df.loc[formula]['D']
    if temp < tmin or temp > tmax:
        raise ValueError(
            f'Temperature out of range. Applicable values are {tmin} - {tmax} K for {formula} gas.'
            )
    mu = a + b * temp + c * temp ** 2 + d * temp ** 3
    if full:
        return mu, cas, tmin, tmax, a, b, c, d
    else:
        return mu
