def lucas_gas(T, Tc, Pc, Zc, MW, dipole=<NUM_LIT:0>, CASRN=None):
Tr = T/Tc<EOL>xi = <NUM_LIT>*(Tc/MW**<NUM_LIT:3>/(Pc/<NUM_LIT>)**<NUM_LIT:4>)**(<NUM_LIT:1>/<NUM_LIT>)  <EOL>if dipole is None:<EOL><INDENT>dipole = <NUM_LIT:0><EOL><DEDENT>dipoler = <NUM_LIT>*dipole**<NUM_LIT:2>*(Pc/<NUM_LIT>)/Tc**<NUM_LIT:2>  <EOL>if dipoler < <NUM_LIT>:<EOL><INDENT>Fp = <NUM_LIT:1><EOL><DEDENT>elif <NUM_LIT> <= dipoler < <NUM_LIT>:<EOL><INDENT>Fp = <NUM_LIT:1> + <NUM_LIT>*(<NUM_LIT> - Zc)**<NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>Fp = <NUM_LIT:1> + <NUM_LIT>*(<NUM_LIT> - Zc)**<NUM_LIT>*abs(<NUM_LIT> + <NUM_LIT:0.1>*(Tr-<NUM_LIT>))<EOL><DEDENT>if CASRN and CASRN in _lucas_Q_dict:<EOL><INDENT>Q = _lucas_Q_dict[CASRN]<EOL>if Tr - <NUM_LIT:12> > <NUM_LIT:0>:<EOL><INDENT>value = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>value = -<NUM_LIT:1><EOL><DEDENT>FQ = <NUM_LIT>*Q**<NUM_LIT>*(<NUM_LIT:1> + <NUM_LIT>*((Tr-<NUM_LIT:12>)**<NUM_LIT:2>)**(<NUM_LIT:1.>/MW)*value)<EOL><DEDENT>else:<EOL><INDENT>FQ = <NUM_LIT:1><EOL><DEDENT>eta = (<NUM_LIT>*Tr**<NUM_LIT> - <NUM_LIT>*exp(-<NUM_LIT>*Tr) + <NUM_LIT>*exp(-<NUM_LIT>*Tr) + <NUM_LIT>)*Fp*FQ/xi<EOL>return eta/<NUM_LIT><EOL>
r'''Estimate the viscosity of a gas using an emperical
    formula developed in several sources, but as discussed in [1]_ as the
    original sources are in German or merely personal communications with the
    authors of [1]_.

    .. math::
        \eta  = \left[0.807T_r^{0.618}-0.357\exp(-0.449T_r) + 0.340\exp(-4.058
        T_r) + 0.018\right]F_p^\circ F_Q^\circ /\xi

        F_p^\circ=1, 0 \le \mu_{r} < 0.022

        F_p^\circ = 1+30.55(0.292-Z_c)^{1.72}, 0.022 \le \mu_{r} < 0.075

        F_p^\circ = 1+30.55(0.292-Z_c)^{1.72}|0.96+0.1(T_r-0.7)| 0.075 < \mu_{r}

        F_Q^\circ = 1.22Q^{0.15}\left\{ 1+0.00385[(T_r-12)^2]^{1/M}\text{sign}
        (T_r-12)\right\}

        \mu_r = 52.46 \frac{\mu^2 P_c}{T_c^2}

        \xi=0.176\left(\frac{T_c}{MW^3 P_c^4}\right)^{1/6}

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc: float
        Critical point of fluid [K]
    Pc : float
        Critical pressure of the fluid [Pa]
    Zc : float
        Critical compressibility of the fluid [Pa]
    dipole : float
        Dipole moment of fluid [debye]
    CASRN : str, optional
        CAS of the fluid

    Returns
    -------
    mu_g : float
        Viscosity of gas, [Pa*s]

    Notes
    -----
    The example is from [1]_; all results agree.
    Viscosity is calculated in micropoise, and converted to SI internally (1E-7).
    Q for He = 1.38; Q for H2 = 0.76; Q for D2 = 0.52.

    Examples
    --------
    >>> lucas_gas(T=550., Tc=512.6, Pc=80.9E5, Zc=0.224, MW=32.042, dipole=1.7)
    1.7822676912698928e-05

    References
    ----------
    .. [1] Reid, Robert C.; Prausnitz, John M.; Poling, Bruce E.
       Properties of Gases and Liquids. McGraw-Hill Companies, 1987.