def Func(arg_0, arg_1, arg_2, arg_3=True):
        r'''Method to calculate `T` from a specified `P` and `V` for the PRSV
        EOS. Uses `Tc`, `a`, `b`, `kappa0`  and `kappa` as well, obtained from
        the class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (somewhat faster) or
            individual formulas.

        Returns
        -------
        T : float
            Temperature, [K]

        Notes
        -----
        Not guaranteed to produce a solution. There are actually two solution,
        one much higher than normally desired; it is possible the solver could
        converge on this.
        '''
        arg_4, arg_5, arg_6, arg_7, arg_8 = arg_0.Tc, arg_0.a, arg_0.b, arg_0.kappa0, arg_0.kappa1
        if arg_3:
            arg_9 = arg_2 - arg_6
            arg_10 = R/arg_9
            arg_11 = (100.*(arg_2*(arg_2 + arg_6) + arg_6*arg_9))
            arg_12 = 10.*arg_7
            arg_13 = arg_8*10.
            arg_14 = arg_8*7.
            def to_solve(arg_15):
                arg_16 = arg_15/arg_4
                arg_17 = arg_16**0.5
                return (arg_15*arg_10 - arg_5*((arg_12 - (arg_13*arg_16 - arg_14)*(arg_17 + 1.))*(arg_17 - 1.) - 10.)**2/arg_11) - arg_1
        else:
            def to_solve(arg_15):
                arg_18 = R*arg_15/(arg_2 - arg_6) - arg_5*((arg_7 + arg_8*(sqrt(arg_15/arg_4) + 1)*(-arg_15/arg_4 + 7/10))*(-sqrt(arg_15/arg_4) + 1) + 1)**2/(arg_2*(arg_2 + arg_6) + arg_6*(arg_2 - arg_6))
                return arg_18 - arg_1
        return newton(to_solve, arg_4*0.5)


def Func(arg_0, arg_1, arg_2):
        r'''Method to calculate `T` from a specified `P` and `V` for the VDW
        EOS. Uses `a`, and `b`, obtained from the class's namespace.

        .. math::
            T =  \frac{1}{R V^{2}} \left(P V^{2} \left(V - b\right)
            + V a - a b\right)

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]

        Returns
        -------
        T : float
            Temperature, [K]
        '''
        return (arg_1*arg_2**2*(arg_2 - arg_0.b) + arg_2*arg_0.a - arg_0.a*arg_0.b)/(R*arg_2**2)


def Func(arg_0, arg_1, arg_2, arg_3=True):
        r'''Method to calculate `T` from a specified `P` and `V` for the RK
        EOS. Uses `a`, and `b`, obtained from the class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas

        Returns
        -------
        T : float
            Temperature, [K]

        Notes
        -----
        The exact solution can be derived as follows; it is excluded for
        breviety.

        >>> from sympy import *
        >>> P, T, V, R = symbols('P, T, V, R')
        >>> Tc, Pc = symbols('Tc, Pc')
        >>> a, b = symbols('a, b')

        >>> RK = Eq(P, R*T/(V-b) - a/sqrt(T)/(V*V + b*V))
        >>> # solve(RK, T)
        '''
        arg_4, arg_5 = arg_0.a, arg_0.b
        if arg_3:
            arg_6 = -1.j*1.7320508075688772 + 1.
            arg_7 = arg_2 - arg_5
            arg_8 = arg_7/R
            arg_9 = arg_2 + arg_5
            arg_10 = (1.7320508075688772*(arg_7*arg_7*(-4.*arg_1*arg_1*arg_1*arg_8 + 27.*arg_4*arg_4/(arg_2*arg_2*arg_9*arg_9))/(R*R))**0.5 - 9.*arg_4*arg_8/(arg_2*arg_9) +0j)**(1./3.)
            return (3.3019272488946263*(11.537996562459266*arg_1*arg_8/(arg_6*arg_10) + 1.2599210498948732*arg_6*arg_10)**2/144.0).real
        else:
            return ((-(-1/2 + sqrt(3)*1j/2)*(sqrt(729*(-arg_2*arg_4 + arg_4*arg_5)**2/(R*arg_2**2 + R*arg_2*arg_5)**2 + 108*(-arg_1*arg_2 + arg_1*arg_5)**3/R**3)/2 + 27*(-arg_2*arg_4 + arg_4*arg_5)/(2*(R*arg_2**2 + R*arg_2*arg_5))+0j)**(1/3)/3 + (-arg_1*arg_2 + arg_1*arg_5)/(R*(-1/2 + sqrt(3)*1j/2)*(sqrt(729*(-arg_2*arg_4 + arg_4*arg_5)**2/(R*arg_2**2 + R*arg_2*arg_5)**2 + 108*(-arg_1*arg_2 + arg_1*arg_5)**3/R**3)/2 + 27*(-arg_2*arg_4 + arg_4*arg_5)/(2*(R*arg_2**2 + R*arg_2*arg_5))+0j)**(1/3)))**2).real


def Func(arg_0, arg_1, arg_2, arg_3=True):
        r'''Method to calculate `T` from a specified `P` and `V` for the API
        SRK EOS. Uses `a`, `b`, and `Tc` obtained from the class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas

        Returns
        -------
        T : float
            Temperature, [K]

        Notes
        -----
        If S2 is set to 0, the solution is the same as in the SRK EOS, and that
        is used. Otherwise, newton's method must be used to solve for `T`.
        There are 8 roots of T in that case, six of them real. No guarantee can
        be made regarding which root will be obtained.
        '''
        if arg_0.S2 == 0:
            arg_0.m = arg_0.S1
            return SRK.Func(arg_0, arg_1, arg_2, arg_3=arg_3)
        else:
            # Previously coded method is  63 microseconds vs 47 here
#            return super(SRK, self).Func(P, V, quick=quick)
            arg_5, arg_6, arg_7, arg_8, arg_9 = arg_0.Tc, arg_0.a, arg_0.b, arg_0.S1, arg_0.S2
            if arg_3:
                arg_10 = R/(arg_2-arg_7)
                arg_11 = (arg_2*(arg_2 + arg_7))
                def to_solve(arg_12):
                    arg_13 = (arg_12/arg_5)**0.5
                    arg_14 = arg_13 - 1.
                    return (arg_10*arg_12 - arg_6*(arg_8*arg_14 + arg_9*arg_14/arg_13 - 1.)**2/arg_11) - arg_1
            else:
                def to_solve(arg_12):
                    arg_15 = R*arg_12/(arg_2 - arg_7) - arg_6*(arg_8*(-sqrt(arg_12/arg_5) + 1) + arg_9*(-sqrt(arg_12/arg_5) + 1)/sqrt(arg_12/arg_5) + 1)**2/(arg_2*(arg_2 + arg_7))
                    return arg_15 - arg_1
            return newton(to_solve, arg_5*0.5)


def Func(arg_0, arg_1, arg_2=True, arg_3=True):
        r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.Func` for more
        documentation. Uses the set values of `Tc`, `omega`, and `a`.

        Because of its similarity for the TWUPR EOS, this has been moved to an
        external `TWU_a_alpha_common` function. See it for further
        documentation.
        '''
        return TWU_a_alpha_common(arg_1, arg_0.Tc, arg_0.omega, arg_0.a, arg_2=arg_2, arg_3=arg_3, method='SRK')


def Func(arg_0, arg_1=False, arg_2=None, arg_3=[arg_4]):
    r'''This function handles the retrieval of a chemical's boiling
    point. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'CRC Physical Constants, organic' for organic
    chemicals, and 'CRC Physical Constants, inorganic' for inorganic
    chemicals. Function has data for approximately 13000 chemicals.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Boiling temperature, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of four methods are available for this function. They are:

        * 'CRC_ORG', a compillation of data on organics
          as published in [1]_.
        * 'CRC_INORG', a compillation of data on
          inorganic as published in [1]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [2]_.
        * 'PSAT_DEFINITION', calculation of boiling point from a
          vapor pressure calculation. This is normally off by a fraction of a
          degree even in the best cases. Listed in IgnoreMethods by default
          for performance reasons.

    Examples
    --------
    >>> Func('7732-18-5')
    373.124

    References
    ----------
    .. [1] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [2] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    def list_methods():
        arg_5 = []
        if arg_0 in CRC_inorganic_data.index and not np.isnan(CRC_inorganic_data.at[arg_0, 'Func']):
            arg_5.append(CRC_INORG)
        if arg_0 in CRC_organic_data.index and not np.isnan(CRC_organic_data.at[arg_0, 'Func']):
            arg_5.append(CRC_ORG)
        if arg_0 in Yaws_data.index:
            arg_5.append(YAWS)
        if arg_4 not in arg_3:
            try:
                # For some chemicals, vapor pressure range will exclude Func
                VaporPressure(arg_0=arg_0).solve_prop(101325.)
                arg_5.append(arg_4)
            except:  # pragma: no cover
                pass
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_5:
                    arg_5.remove(arg_2)
        arg_5.append(NONE)
        return arg_5
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == CRC_INORG:
        return float(CRC_inorganic_data.at[arg_0, 'Func'])
    elif arg_2 == CRC_ORG:
        return float(CRC_organic_data.at[arg_0, 'Func'])
    elif arg_2 == YAWS:
        return float(Yaws_data.at[arg_0, 'Func'])
    elif arg_2 == arg_4:
        return VaporPressure(arg_0=arg_0).solve_prop(101325.)
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')


def Func(arg_0, arg_1=False, arg_2=None, arg_3=[]):
    r'''This function handles the retrieval of a chemical's melting
    point. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'Open Notebook Melting Points', with backup sources
    'CRC Physical Constants, organic' for organic chemicals, and
    'CRC Physical Constants, inorganic' for inorganic chemicals. Function has
    data for approximately 14000 chemicals.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Melting temperature, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'OPEN_NTBKM, a compillation of data on organics
          as published in [1]_ as Open Notebook Melting Points; Averaged
          (median) values were used when
          multiple points were available. For more information on this
          invaluable and excellent collection, see
          http://onswebservices.wikispaces.com/meltingpoint.
        * 'CRC_ORG', a compillation of data on organics
          as published in [2]_.
        * 'CRC_INORG', a compillation of data on
          inorganic as published in [2]_.

    Examples
    --------
    >>> Func(CASRN='7732-18-5')
    273.15

    References
    ----------
    .. [1] Bradley, Jean-Claude, Antony Williams, and Andrew Lang.
       "Jean-Claude Bradley Open Melting Point Dataset", May 20, 2014.
       https://figshare.com/articles/Jean_Claude_Bradley_Open_Melting_Point_Datset/1031637.
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    '''
    def list_methods():
        arg_4 = []
        if arg_0 in Func_ON_data.index:
            arg_4.append(OPEN_NTBKM)
        if arg_0 in CRC_inorganic_data.index and not np.isnan(CRC_inorganic_data.at[arg_0, 'Func']):
            arg_4.append(CRC_INORG)
        if arg_0 in CRC_organic_data.index and not np.isnan(CRC_organic_data.at[arg_0, 'Func']):
            arg_4.append(CRC_ORG)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_4:
                    arg_4.remove(arg_2)
        arg_4.append(NONE)
        return arg_4
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == OPEN_NTBKM:
        return float(Func_ON_data.at[arg_0, 'Func'])
    elif arg_2 == CRC_INORG:
        return float(CRC_inorganic_data.at[arg_0, 'Func'])
    elif arg_2 == CRC_ORG:
        return float(CRC_organic_data.at[arg_0, 'Func'])
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')


def Func(arg_0, arg_1, arg_2, arg_3=1, arg_4=101325):
    r'''Calculates enthalpy of vaporization at arbitrary temperatures using the
    Func equation.

    The enthalpy of vaporization is given by:

    .. math::
        \Delta H_{vap} = RT \Delta Z \frac{\ln (P_c/Psat)}{(1-T_{r})}

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    dZ : float
        Change in compressibility factor between liquid and gas, []
    Psat : float
        Saturation pressure of fluid [Pa], optional

    Returns
    -------
    Hvap : float
        Enthalpy of vaporization, [J/mol]

    Notes
    -----
    No original source is available for this equation.
    [1]_ claims this equation overpredicts enthalpy by several percent.
    Under Tr = 0.8, dZ = 1 is a reasonable assumption.
    This equation is most accurate at the normal boiling point.

    Internal units are bar.

    WARNING: I believe it possible that the adjustment for pressure may be incorrect

    Examples
    --------
    Problem from Perry's examples.

    >>> Func(T=294.0, Tc=466.0, Pc=5.55E6)
    26512.354585061985

    References
    ----------
    .. [1] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition.
       New York: McGraw-Hill Professional, 2000.
    '''
    arg_5 = arg_0/arg_1
    return R*arg_0*arg_3*log(arg_2/arg_4)/(1. - arg_5)


def Func(arg_0=298.15, arg_1=101325, arg_2=None, arg_3=False, arg_4=None, arg_5=''):  # pragma: no cover
    '''This function handles the calculation of a chemical's enthalpy of fusion.
    Generally this, is used by the chemical class, as all parameters are passed.
    Calling the function directly works okay.

    Enthalpy of fusion is a weak function of pressure, and its effects are
    neglected.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    '''
    def list_methods():
        arg_6 = []
        if arg_5 in CRCFunc_data.index:
            arg_6.append('CRC, at melting point')
        arg_6.append('None')
        return arg_6
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_4 == 'CRC, at melting point':
        arg_7 = CRCFunc_data.at[arg_5, 'Func']
    elif arg_4 == 'None' or not arg_2:
        arg_7 = None
    else:
        raise Exception('Failure in in function')
    arg_7 = property_molar_to_mass(arg_7, arg_2)
    return arg_7


def Func(arg_0=298.15, arg_1=101325, arg_2=None, arg_3=False, arg_4=None, arg_5=''):  # pragma: no cover
    '''This function handles the calculation of a chemical's enthalpy of sublimation.
    Generally this, is used by the chemical class, as all parameters are passed.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.
    '''
    def list_methods():
        arg_6 = []
#        if Hfus(T=T, P=P, MW=MW, CASRN=CASRN) and Hvap(T=T, P=P, MW=MW, CASRN=CASRN):
#            methods.append('Hfus + Hvap')
        if arg_5 in GharagheiziFunc_data.index:
            arg_6.append('Ghazerati Appendix, at 298K')
        arg_6.append('None')
        return arg_6
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]
    # This is the calculate, given the method section
#    if Method == 'Hfus + Hvap':
#        p1 = Hfus(T=T, P=P, MW=MW, CASRN=CASRN)
#        p2 = Hvap(T=T, P=P, MW=MW, CASRN=CASRN)
#        if p1 and p2:
#            _Func = p1 + p2
#        else:
#            _Func = None
    if arg_4 == 'Ghazerati Appendix, at 298K':
        arg_7 = float(GharagheiziFunc_data.at[arg_5, 'Func'])
    elif arg_4 == 'None' or not arg_7 or not arg_2:
        return None
    else:
        raise Exception('Failure in in function')
    arg_7 = property_molar_to_mass(arg_7, arg_2)
    return arg_7


def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=False,
              arg_5=None):  # pragma: no cover
    '''This function handles the retrival of a mixtures's liquidus point.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> Func(Tms=[250.0, 350.0], xs=[0.5, 0.5])
    350.0
    >>> Func(Tms=[250, 350], xs=[0.5, 0.5], Method='Simple')
    300.0
    >>> Func(Tms=[250, 350], xs=[0.5, 0.5], AvailableMethods=True)
    ['Maximum', 'Simple', 'None']
    '''
    def list_methods():
        arg_6 = []
        if none_and_length_check([arg_0]):
            arg_6.append('Maximum')
            arg_6.append('Simple')
        arg_6.append('None')
        return arg_6
    if arg_4:
        return list_methods()
    if not arg_5:
        arg_5 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_5 == 'Maximum':
        arg_7 = max(arg_0)
    elif arg_5 == 'Simple':
        arg_7 = mixing_simple(arg_2, arg_0)
    elif arg_5 == 'None':
        return None
    else:
        raise Exception('Failure in in function')
    return arg_7


def Func(arg_0=298.15, arg_1=None, arg_2=None,
                         arg_3='', arg_4=False, arg_5=None):
    r'''This function handles the calculation of a chemical's solubility
    parameter. Calculation is a function of temperature, but is not always
    presented as such. No lookup values are available; either `Hvapm`, `Vml`,
    and `T` are provided or the calculation cannot be performed.

    .. math::
        \delta = \sqrt{\frac{\Delta H_{vap} - RT}{V_m}}

    Parameters
    ----------
    T : float
        Temperature of the fluid [k]
    Hvapm : float
        Heat of vaporization [J/mol/K]
    Vml : float
        Specific volume of the liquid [m^3/mol]
    CASRN : str, optional
        CASRN of the fluid, not currently used [-]

    Returns
    -------
    delta : float
        Solubility parameter, [Pa^0.5]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain the solubility parameter
        with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the solubility parameter for the desired chemical, and will return
        methods instead of the solubility parameter

    Notes
    -----
    Undefined past the critical point. For convenience, if Hvap is not defined,
    an error is not raised; None is returned instead. Also for convenience,
    if Hvapm is less than RT, None is returned to avoid taking the root of a
    negative number.

    This parameter is often given in units of cal/ml, which is 2045.48 times
    smaller than the value returned here.

    Examples
    --------
    Pentane at STP

    >>> Func(T=298.2, Hvapm=26403.3, Vml=0.000116055)
    14357.681538173534

    References
    ----------
    .. [1] Barton, Allan F. M. CRC Handbook of Solubility Parameters and Other
       Cohesion Parameters, Second Edition. CRC Press, 1991.
    '''
    def list_methods():
        arg_6 = []
        if arg_0 and arg_1 and arg_2:
            arg_6.append(DEFINITION)
        arg_6.append(NONE)
        return arg_6
    if arg_4:
        return list_methods()
    if not arg_5:
        arg_5 = list_methods()[0]

    if arg_5 == DEFINITION:
        if (not arg_1) or (not arg_0) or (not arg_2):
            arg_7 = None
        else:
            if arg_1 < R*arg_0 or arg_2 < 0:  # Prevent taking the root of a negative number
                arg_7 = None
            else:
                arg_7 = ((arg_1 - R*arg_0)/arg_2)**0.5
    elif arg_5 == NONE:
        arg_7 = None
    else:
        raise Exception('Failure in in function')
    return arg_7


def Func(arg_0, arg_1, arg_2, arg_3=0, arg_4=0, arg_5=1):
    r'''Returns the maximum solubility of a solute in a solvent.

    .. math::
        \ln x_i^L \gamma_i^L = \frac{\Delta H_{m,i}}{RT}\left(
        1 - \frac{T}{T_{m,i}}\right) - \frac{\Delta C_{p,i}(T_{m,i}-T)}{RT}
        + \frac{\Delta C_{p,i}}{R}\ln\frac{T_m}{T}

        \Delta C_{p,i} = C_{p,i}^L - C_{p,i}^S

    Parameters
    ----------
    T : float
        Temperature of the system [K]
    Tm : float
        Melting temperature of the solute [K]
    Hm : float
        Heat of melting at the melting temperature of the solute [J/mol]
    Cpl : float, optional
        Molar heat capacity of the solute as a liquid [J/mol/K]
    Cpls: float, optional
        Molar heat capacity of the solute as a solid [J/mol/K]
    gamma : float, optional
        Activity coefficient of the solute as a liquid [-]

    Returns
    -------
    x : float
        Mole fraction of solute at maximum solubility [-]

    Notes
    -----
    gamma is of the solute in liquid phase

    Examples
    --------
    From [1]_, matching example

    >>> Func(T=260., Tm=278.68, Hm=9952., Cpl=0, Cps=0, gamma=3.0176)
    0.24340068761677464

    References
    ----------
    .. [1] Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation.
       Weinheim, Germany: Wiley-VCH, 2012.
    '''
    arg_6 = arg_3-arg_4
    arg_7 = exp(- arg_2/R/arg_0*(1-arg_0/arg_1) + arg_6*(arg_1-arg_0)/R/arg_0 - arg_6/R*log(arg_1/arg_0))/arg_5
    return arg_7


def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
    r'''Returns the freezing point depression caused by a solute in a solvent.
    Can use either the mole fraction of the solute or its molality and the
    molecular weight of the solvent. Assumes ideal system behavior.

    .. math::
        \Delta T_m = \frac{R T_m^2 x}{\Delta H_m}

        \Delta T_m = \frac{R T_m^2 (MW) M}{1000 \Delta H_m}

    Parameters
    ----------
    Tm : float
        Melting temperature of the solute [K]
    Hm : float
        Heat of melting at the melting temperature of the solute [J/mol]
    x : float, optional
        Mole fraction of the solute [-]
    M : float, optional
        Molality [mol/kg]
    MW: float, optional
        Molecular weight of the solvent [g/mol]

    Returns
    -------
    dTm : float
        Freezing point depression [K]

    Notes
    -----
    MW is the molecular weight of the solvent. M is the molality of the solute.

    Examples
    --------
    From [1]_, matching example.

    >>> Func(353.35, 19110, .02)
    1.0864594900639515

    References
    ----------
    .. [1] Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation.
       Weinheim, Germany: Wiley-VCH, 2012.
    '''
    if arg_2:
        arg_5 = R*arg_0**2*arg_2/arg_1
    elif arg_3 and arg_4:
        arg_4 = arg_4/1000. #g/mol to kg/mol
        arg_5 = R*arg_0**2*arg_4*arg_3/arg_1
    else:
        raise Exception('Either molality or mole fraction of the solute must be specified; MW of the solvent is required also if molality is provided')
    return arg_5


def Func(arg_0, arg_1, arg_2, arg_3):
    r'''Calculates saturation liquid volume, using Func CSP method and
    critical properties.

    The molar volume of a liquid is given by:

    .. math::
        V_s = \frac{RT_c}{P_c}{Z_c}^{[1+(1-{T/T_c})^{2/7} ]}

    Units are all currently in m^3/mol - this can be changed to kg/m^3

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    Zc : float
        Critical compressibility of fluid, [-]

    Returns
    -------
    Vs : float
        Saturation liquid volume, [m^3/mol]

    Notes
    -----
    Units are dependent on gas constant R, imported from scipy
    According to Reid et. al, underpredicts volume for compounds with Zc < 0.22

    Examples
    --------
    Propane, example from the API Handbook

    >>> Vm_to_rho(Func(272.03889, 369.83, 4248000.0, 0.2763), 44.09562)
    531.3223212651092

    References
    ----------
    .. [1] Func, Harold G. "Equation of State for Saturated Liquids."
       Journal of Chemical & Engineering Data 15, no. 4 (1970): 514-517.
       doi:10.1021/je60047a012
    '''
    return R*arg_1/arg_2*arg_3**(1 + (1 - arg_0/arg_1)**(2/7.))


def Func(arg_0, arg_1, arg_2, arg_3):
    r'''Calculates saturation liquid volume, using Yamada and Gunn CSP method
    and a chemical's critical properties and acentric factor.

    The molar volume of a liquid is given by:

    .. math::
        V_s = \frac{RT_c}{P_c}{(0.29056-0.08775\omega)}^{[1+(1-{T/T_c})^{2/7}]}

    Units are in m^3/mol.

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    omega : float
        Acentric factor for fluid, [-]

    Returns
    -------
    Vs : float
        saturation liquid volume, [m^3/mol]

    Notes
    -----
    This equation is an improvement on the Rackett equation.
    This is often presented as the Rackett equation.
    The acentric factor is used here, instead of the critical compressibility
    A variant using a reference fluid also exists

    Examples
    --------
    >>> Func(300, 647.14, 22048320.0, 0.245)
    2.1882836429895796e-05

    References
    ----------
    .. [1] Gunn, R. D., and Tomoyoshi Yamada. "A Corresponding States
        Correlation of Saturated Liquid Volumes." AIChE Journal 17, no. 6
        (1971): 1341-45. doi:10.1002/aic.690170613
    .. [2] Yamada, Tomoyoshi, and Robert D. Gunn. "Saturated Liquid Molar
        Volumes. Rackett Equation." Journal of Chemical & Engineering Data 18,
        no. 2 (1973): 234-36. doi:10.1021/je60057a006
    '''
    return R*arg_1/arg_2*(0.29056 - 0.08775*arg_3)**(1 + (1 - arg_0/arg_1)**(2/7.))


def Func(arg_0, arg_1, arg_2, arg_3):
    r'''Calculates saturation liquid density, using the Townsend and Hales
    CSP method as modified from the original Riedel equation. Uses
    chemical critical volume and temperature, as well as acentric factor

    The density of a liquid is given by:

    .. math::
        Vs = V_c/\left(1+0.85(1-T_r)+(1.692+0.986\omega)(1-T_r)^{1/3}\right)

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Vc : float
        Critical volume of fluid [m^3/mol]
    omega : float
        Acentric factor for fluid, [-]

    Returns
    -------
    Vs : float
        Saturation liquid volume, [m^3/mol]

    Notes
    -----
    The requirement for critical volume and acentric factor requires all data.

    Examples
    --------
    >>> Func(300, 647.14, 55.95E-6, 0.3449)
    1.8007361992619923e-05

    References
    ----------
    .. [1] Hales, J. L, and R Townsend. "Liquid Densities from 293 to 490 K of
       Nine Aromatic Hydrocarbons." The Journal of Chemical Thermodynamics
       4, no. 5 (1972): 763-72. doi:10.1016/0021-9614(72)90050-X
    '''
    arg_4 = arg_0/arg_1
    return arg_2/(1 + 0.85*(1-arg_4) + (1.692 + 0.986*arg_3)*(1-arg_4)**(1/3.))


def Func(arg_0, arg_1, arg_2, arg_3):
    r'''Calculate saturation liquid density using the Func CSP method.

    A popular and accurate estimation method. If possible, fit parameters are
    used; alternatively critical properties work well.

    The density of a liquid is given by:

    .. math::
        V_s=V^*V^{(0)}[1-\omega_{SRK}V^{(\delta)}]

        V^{(0)}=1-1.52816(1-T_r)^{1/3}+1.43907(1-T_r)^{2/3}
        - 0.81446(1-T_r)+0.190454(1-T_r)^{4/3}

        V^{(\delta)}=\frac{-0.296123+0.386914T_r-0.0427258T_r^2-0.0480645T_r^3}
        {T_r-1.00001}

    Units are that of critical or fit constant volume.

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Vc : float
        Critical volume of fluid [m^3/mol].
        This parameter is alternatively a fit parameter
    omega : float
        (ideally SRK) Acentric factor for fluid, [-]
        This parameter is alternatively a fit parameter.

    Returns
    -------
    Vs : float
        Saturation liquid volume

    Notes
    -----
    196 constants are fit to this function in [1]_.
    Range: 0.25 < Tr < 0.95, often said to be to 1.0

    This function has been checked with the API handbook example problem.

    Examples
    --------
    Propane, from an example in the API Handbook

    >>> Vm_to_rho(Func(272.03889, 369.83333, 0.20008161E-3, 0.1532), 44.097)
    530.3009967969841

    References
    ----------
    .. [1] Hankinson, Risdon W., and George H. Thomson. "A New Correlation for
       Saturated Densities of Liquids and Their Mixtures." AIChE Journal
       25, no. 4 (1979): 653-663. doi:10.1002/aic.690250412
    '''
    arg_4 = arg_0/arg_1
    arg_5 = (-0.296123 + 0.386914*arg_4 - 0.0427258*arg_4**2
        - 0.0480645*arg_4**3)/(arg_4 - 1.00001)
    arg_6 = 1 - 1.52816*(1-arg_4)**(1/3.) + 1.43907*(1-arg_4)**(2/3.) \
        - 0.81446*(1-arg_4) + 0.190454*(1-arg_4)**(4/3.)
    return arg_2*arg_6*(1-arg_3*arg_5)


def Func(arg_0, arg_1):
    r'''Calculate mixture liquid density using the Func mixing rule.
    Highly inacurate, but easy to use. Assumes idea liquids with
    no excess volume. Average molecular weight should be used with it to obtain
    density.

    .. math::
        V_{mix} = \sum_i x_i V_i

    or in terms of density:

    .. math::

        \rho_{mix} = \sum\frac{x_i}{\rho_i}

    Parameters
    ----------
    xs : array
        Mole fractions of each component, []
    Vms : array
        Molar volumes of each fluids at conditions [m^3/mol]

    Returns
    -------
    Vm : float
        Mixture liquid volume [m^3/mol]

    Notes
    -----
    Units are that of the given volumes.
    It has been suggested to use this equation with weight fractions,
    but the results have been less accurate.

    Examples
    --------
    >>> Func([0.5, 0.5], [4.057e-05, 5.861e-05])
    4.9590000000000005e-05
    '''
    if not none_and_length_check([arg_0, arg_1]):
        raise Exception('Function inputs are incorrect format')
    return mixing_simple(arg_0, arg_1)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    r'''Calculate mixture liquid density using the COSTALD CSP method.

    A popular and accurate estimation method. If possible, fit parameters are
    used; alternatively critical properties work well.

    The mixing rules giving parameters for the pure component COSTALD
    equation are:

    .. math::
        T_{cm} = \frac{\sum_i\sum_j x_i x_j (V_{ij}T_{cij})}{V_m}

        V_m = 0.25\left[ \sum x_i V_i + 3(\sum x_i V_i^{2/3})(\sum_i x_i V_i^{1/3})\right]

        V_{ij}T_{cij} = (V_iT_{ci}V_{j}T_{cj})^{0.5}

        \omega = \sum_i z_i \omega_i

    Parameters
    ----------
    xs: list
        Mole fractions of each component
    T : float
        Temperature of fluid [K]
    Tcs : list
        Critical temperature of fluids [K]
    Vcs : list
        Critical volumes of fluids [m^3/mol].
        This parameter is alternatively a fit parameter
    omegas : list
        (ideally SRK) Acentric factor of all fluids, [-]
        This parameter is alternatively a fit parameter.

    Returns
    -------
    Vs : float
        Saturation liquid mixture volume

    Notes
    -----
    Range: 0.25 < Tr < 0.95, often said to be to 1.0
    No example has been found.
    Units are that of critical or fit constant volume.

    Examples
    --------
    >>> Func([0.4576, 0.5424], 298.,  [512.58, 647.29],[0.000117, 5.6e-05], [0.559,0.344] )
    2.706588773271354e-05

    References
    ----------
    .. [1] Hankinson, Risdon W., and George H. Thomson. "A New Correlation for
       Saturated Densities of Liquids and Their Mixtures." AIChE Journal
       25, no. 4 (1979): 653-663. doi:10.1002/aic.690250412
    '''
    arg_5 = range(len(arg_0))
    if not none_and_length_check([arg_0, arg_2, arg_3, arg_4]):
        raise Exception('Function inputs are incorrect format')
    arg_6 = sum([xi*Vci for xi, Vci in zip(arg_0, arg_3)])
    arg_7 = sum([xi*Vci**(2/3.) for xi, Vci in zip(arg_0, arg_3)])
    arg_8 = sum([xi*Vci**(1/3.) for xi, Vci in zip(arg_0, arg_3)])
    arg_9 = 0.25*(arg_6 + 3.*arg_7*arg_8)
    arg_10 = [[(arg_2[i]*arg_2[j]*arg_3[i]*arg_3[j])**0.5 for j in arg_5] for i in arg_5]
    arg_11 = mixing_simple(arg_0, arg_4)
    arg_12 = sum([arg_0[i]*arg_0[j]*arg_10[i][j]/arg_9 for j in arg_5 for i in arg_5])
    return COSTALD(arg_1, arg_12, arg_9, arg_11)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        r'''Method to Func molar volume of a liquid mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func the property, [K]
        P : float
            Pressure at which to Func the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid mixture at the given conditions,
            [m^3/mol]
        '''
        if arg_5 == SIMPLE:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.VolumeLiquids]
            return Amgat(arg_3, arg_6)
        elif arg_5 == COSTALD_MIXTURE:
            return COSTALD_mixture(arg_3, arg_1, arg_0.Tcs, arg_0.Vcs, arg_0.omegas)
        elif arg_5 == COSTALD_MIXTURE_FIT:
            return COSTALD_mixture(arg_3, arg_1, arg_0.Tcs, arg_0.COSTALD_Vchars, arg_0.COSTALD_omegas)
        elif arg_5 == RACKETT:
            return Rackett_mixture(arg_1, arg_3, arg_0.MWs, arg_0.Tcs, arg_0.Pcs, arg_0.Zcs)
        elif arg_5 == RACKETT_PARAMETERS:
            return Rackett_mixture(arg_1, arg_3, arg_0.MWs, arg_0.Tcs, arg_0.Pcs, arg_0.Z_RAs)
        elif arg_5 == LALIBERTE:
            arg_4 = list(arg_4) ; arg_4.pop(arg_0.index_w)
            arg_7 = Laliberte_density(arg_1, arg_4, arg_0.wCASs)
            arg_8 = mixing_simple(arg_3, arg_0.MWs)
            return rho_to_Vm(arg_7, arg_8)
        else:
            raise Exception('Method not valid')


def Func(arg_0, arg_1, arg_2, arg_3):
        r'''Method to calculate pressure-dependent gas molar volume at
        temperature `T` and pressure `P` with a given method.

        This method has no exception handling; see `TP_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate molar volume, [K]
        P : float
            Pressure at which to calculate molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the gas at T and P, [m^3/mol]
        '''
        if arg_3 == EOS:
            arg_0.eos[0] = arg_0.eos[0].to_TP(arg_1=arg_1, arg_2=arg_2)
            arg_5 = arg_0.eos[0].V_g
        elif arg_3 == TSONOPOULOS_EXTENDED:
            arg_6 = BVirial_Tsonopoulos_extended(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega, dipole=arg_0.dipole)
            arg_5 = ideal_gas(arg_1, arg_2) + arg_6
        elif arg_3 == TSONOPOULOS:
            arg_6 = BVirial_Tsonopoulos(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
            arg_5 = ideal_gas(arg_1, arg_2) + arg_6
        elif arg_3 == ABBOTT:
            arg_6 = BVirial_Abbott(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
            arg_5 = ideal_gas(arg_1, arg_2) + arg_6
        elif arg_3 == PITZER_CURL:
            arg_6 = BVirial_Pitzer_Curl(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
            arg_5 = ideal_gas(arg_1, arg_2) + arg_6
        elif arg_3 == CRC_VIRIAL:
            arg_7, arg_8, arg_9, arg_10, arg_11 = arg_0.CRC_VIRIAL_coeffs
            arg_12 = 298.15/arg_1 - 1.
            arg_6 = (arg_7 + arg_8*arg_12 + arg_9*arg_12**2 + arg_10*arg_12**3 + arg_11*arg_12**4)/1E6
            arg_5 = ideal_gas(arg_1, arg_2) + arg_6
        elif arg_3 == IDEAL:
            arg_5 = ideal_gas(arg_1, arg_2)
        elif arg_3 == COOLPROP:
            arg_5 = 1./PropsSI('DMOLAR', 'T', arg_1, 'P', arg_2, arg_0.CASRN)
        elif arg_3 in arg_0.tabular_data:
            arg_5 = arg_0.interpolate_P(arg_1, arg_2, arg_3)
        return arg_5


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func the molar volume of a solid at tempearture `T`
        with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vms : float
            Molar volume of the solid at T, [m^3/mol]
        '''
        if arg_2 == CRC_INORG_S:
            arg_3 = arg_0.CRC_INORG_S_Vm
#        elif method == GOODMAN:
#            Vms = Goodman(T, self.Tt, self.rhol_Tt)
        elif arg_2 in arg_0.tabular_data:
            arg_3 = arg_0.interpolate(arg_1, arg_2)
        return arg_3


def Func(arg_0, arg_1=None, arg_2=False, arg_3=None):
    r'''Looks up the legal status of a chemical according to either a specifc
    method or with all methods.

    Returns either the status as a string for a specified method, or the
    status of the chemical in all available data sources, in the format
    {source: status}.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    status : str or dict
        Legal status information [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain legal status with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the legal status for the desired chemical, and will return methods
        instead of the status
    CASi : int, optional
        CASRN as an integer, used internally [-]

    Notes
    -----

    Supported methods are:

        * **DSL**: Canada Domestic Substance List, [1]_. As extracted on Feb 11, 2015
          from a html list. This list is updated continuously, so this version
          will always be somewhat old. Strictly speaking, there are multiple
          lists but they are all bundled together here. A chemical may be
          'Listed', or be on the 'Non-Domestic Substances List (NDSL)',
          or be on the list of substances with 'Significant New Activity (SNAc)',
          or be on the DSL but with a 'Ministerial Condition pertaining to this
          substance', or have been removed from the DSL, or have had a
          Ministerial prohibition for the substance.
        * **TSCA**: USA EPA Toxic Substances Control Act Chemical Inventory, [2]_.
          This list is as extracted on 2016-01. It is believed this list is
          updated on a periodic basis (> 6 month). A chemical may simply be
          'Listed', or may have certain flags attached to it. All these flags
          are described in the dict TSCA_flags.
        * **EINECS**: European INventory of Existing Commercial chemical
          Substances, [3]_. As extracted from a spreadsheet dynamically
          generated at [1]_. This list was obtained March 2015; a more recent
          revision already exists.
        * **NLP**: No Longer Polymers, a list of chemicals with special
          regulatory exemptions in EINECS. Also described at [3]_.
        * **SPIN**: Substances Prepared in Nordic Countries. Also a boolean
          data type. Retrieved 2015-03 from [4]_.

    Other methods which could be added are:

        * Australia: AICS Australian Inventory of Chemical Substances
        * China: Inventory of Existing Chemical Substances Produced or Imported
          in China (IECSC)
        * Europe: REACH List of Registered Substances
        * India: List of Hazardous Chemicals
        * Japan: ENCS: Inventory of existing and new chemical substances
        * Korea: Existing Chemicals Inventory (KECI)
        * Mexico: INSQ National Inventory of Chemical Substances in Mexico
        * New Zealand:  Inventory of Chemicals (NZIoC)
        * Philippines: PICCS Philippines Inventory of Chemicals and Chemical
          Substances

    Examples
    --------
    >>> pprint(Func('64-17-5'))
    {'DSL': 'LISTED',
     'EINECS': 'LISTED',
     'NLP': 'UNLISTED',
     'SPIN': 'LISTED',
     'TSCA': 'LISTED'}

    References
    ----------
    .. [1] Government of Canada.. "Substances Lists" Feb 11, 2015.
       https://www.ec.gc.ca/subsnouvelles-newsubs/default.asp?n=47F768FE-1.
    .. [2] US EPA. "TSCA Chemical Substance Inventory." Accessed April 2016.
       https://www.epa.gov/tsca-inventory.
    .. [3] ECHA. "EC Inventory". Accessed March 2015.
       http://echa.europa.eu/information-on-chemicals/ec-inventory.
    .. [4] SPIN. "SPIN Substances in Products In Nordic Countries." Accessed
       March 2015. http://195.215.202.233/DotNetNuke/default.aspx.
    '''
    load_law_data()
    if not arg_3:
        arg_3 = CAS2int(arg_0)
    arg_4 = [COMBINED, DSL, TSCA, EINECS, NLP, SPIN]
    if arg_2:
        return arg_4
    if not arg_1:
        arg_1 = arg_4[0]
    if arg_1 == DSL:
        if arg_3 in DSL_data.index:
            arg_5 = CAN_DSL_flags[DSL_data.at[arg_3, 'Registry']]
        else:
            arg_5 = UNLISTED
    elif arg_1 == TSCA:
        if arg_3 in TSCA_data.index:
            arg_6 = TSCA_data.loc[arg_3].to_dict()
            if any(arg_6.values()):
                arg_5 = sorted([TSCA_flags[i] for i in arg_6.keys() if arg_6[i]])
            else:
                arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == EINECS:
        if arg_3 in EINECS_data.index:
            arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == NLP:
        if arg_3 in NLP_data.index:
            arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == SPIN:
        if arg_3 in SPIN_data.index:
            arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == COMBINED:
        arg_5 = {}
        for arg_7 in arg_4[1:]:
            arg_5[arg_7] = Func(arg_0, arg_1=arg_7, arg_3=arg_3)
    else:
        raise Exception('Failure in in function')
    return arg_5


def Func(arg_0, arg_1=None, arg_2=False):  # pragma: no cover
    '''Look up the economic status of a chemical.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> pprint(Func(CASRN='98-00-0'))
    ["US public: {'Manufactured': 0.0, 'Imported': 10272.711, 'Exported': 184.127}",
     u'10,000 - 100,000 tonnes per annum',
     'OECD HPV Chemicals']

    >>> Func(CASRN='13775-50-3')  # SODIUM SESQUISULPHATE
    []
    >>> Func(CASRN='98-00-0', Method='OECD high production volume chemicals')
    'OECD HPV Chemicals'
    >>> Func(CASRN='98-01-1', Method='European Chemicals Agency Total Tonnage Bands')
    [u'10,000 - 100,000 tonnes per annum']
    '''
    load_economic_data()
    arg_3 = CAS2int(arg_0)

    def list_methods():
        arg_4 = []
        arg_4.append('Combined')
        if arg_0 in _EPACDRDict:
            arg_4.append(EPACDR)
        if arg_0 in _ECHATonnageDict:
            arg_4.append(ECHA)
        if arg_3 in HPV_data.index:
            arg_4.append(OECD)
        arg_4.append(NONE)
        return arg_4
    if arg_2:
        return list_methods()
    if not arg_1:
        arg_1 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_1 == EPACDR:
        arg_5 = 'US public: ' + str(_EPACDRDict[arg_0])
    elif arg_1 == ECHA:
        arg_5 = _ECHATonnageDict[arg_0]
    elif arg_1 == OECD:
        arg_5 = 'OECD HPV Chemicals'
    elif arg_1 == 'Combined':
        arg_5 = []
        if arg_0 in _EPACDRDict:
            arg_5 += ['US public: ' + str(_EPACDRDict[arg_0])]
        if arg_0 in _ECHATonnageDict:
            arg_5 += _ECHATonnageDict[arg_0]
        if arg_3 in HPV_data.index:
            arg_5 += ['OECD HPV Chemicals']
    elif arg_1 == NONE:
        arg_5 = None
    else:
        raise Exception('Failure in in function')
    return arg_5


def Func(arg_0):
        '''Method to compute all available properties with the Joback method;
        returns their results as a dict. For the tempearture dependent values
        Cpig and mul, both the coefficients and objects to perform calculations
        are returned.
        '''
        # Pre-generate the coefficients or they will not be returned
        arg_0.mul(300)
        arg_0.Cpig(300)
        arg_1 = {'Tb': arg_0.Tb(arg_0.counts),
                     'Tm': arg_0.Tm(arg_0.counts),
                     'Tc': arg_0.Tc(arg_0.counts, arg_0.Tb_Funcd),
                     'Pc': arg_0.Pc(arg_0.counts, arg_0.atom_count),
                     'Vc': arg_0.Vc(arg_0.counts),
                     'Hf': arg_0.Hf(arg_0.counts),
                     'Gf': arg_0.Gf(arg_0.counts),
                     'Hfus': arg_0.Hfus(arg_0.counts),
                     'Hvap': arg_0.Hvap(arg_0.counts),
                     'mul': arg_0.mul,
                     'mul_coeffs': arg_0.calculated_mul_coeffs,
                     'Cpig': arg_0.Cpig,
                     'Cpig_coeffs': arg_0.calculated_Cpig_coeffs}
        return arg_1


def Func(arg_0=None, arg_1=False, arg_2=None, arg_3=True):
    r'''This function handles the retrieval of a chemical's Func.
    Lookup is based on CASRNs. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Function has data for approximately 100 chemicals.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    kappa : float
        Electrical Func of the fluid, [S/m]
    T : float, only returned if full_info == True
        Temperature at which Func measurement was made
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain RI with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead
        of Func
    full_info : bool, optional
        If True, function will return the temperature at which the Func
        reading was made

    Notes
    -----
    Only one source is available in this function. It is:

        * 'LANGE_COND' which is from Lange's Handbook, Table 8.34 Electrical
        Conductivity of Various Pure Liquids', a compillation of data in [1]_.

    Examples
    --------
    >>> Func('7732-18-5')
    (4e-06, 291.15)

    References
    ----------
    .. [1] Speight, James. Lange's Handbook of Chemistry. 16 edition.
       McGraw-Hill Professional, 2005.
    '''
    def list_methods():
        arg_4 = []
        if arg_0 in Lange_cond_pure.index:
            arg_4.append(LANGE_COND)
        arg_4.append(NONE)
        return arg_4
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]
    if arg_2 == LANGE_COND:
        arg_5 = float(Lange_cond_pure.at[arg_0, 'Conductivity'])
        if arg_3:
            arg_6 = float(Lange_cond_pure.at[arg_0, 'T'])

    elif arg_2 == NONE:
        arg_5, arg_6 = None, None
    else:
        raise Exception('Failure in in function')

    if arg_3:
        return arg_5, arg_6
    else:
        return arg_5


def Func(arg_0, arg_1, arg_2, arg_3,
                             arg_4, arg_5, arg_6):
    '''Helper method for balance_ions for the proportional family of methods.
    See balance_ions for a description of the methods; parameters are fairly
    obvious.
    '''
    arg_7 = arg_2[0:arg_3]
    arg_8 = arg_2[arg_3:arg_4+arg_3]
    arg_9 = sum([zi*ci for zi, ci in zip(arg_7, arg_0)])
    arg_10 = sum([zi*ci for zi, ci in zip(arg_8, arg_1)])
    if arg_6 == 'proportional insufficient ions increase':
        if arg_5 < 0:
            arg_11 = -arg_9/arg_10
            arg_8 = [i*arg_11 for i in arg_8]
        else:
            arg_11 = -arg_10/arg_9
            arg_7 = [i*arg_11 for i in arg_7]
    elif arg_6 == 'proportional excess ions decrease':
        if arg_5 < 0:
            arg_11 = -arg_10/arg_9
            arg_7 = [i*arg_11 for i in arg_7]
        else:
            arg_11 = -arg_9/arg_10
            arg_8 = [i*arg_11 for i in arg_8]
    elif arg_6 == 'proportional cation adjustment':
        arg_11 = -arg_9/arg_10
        arg_8 = [i*arg_11 for i in arg_8]
    elif arg_6 == 'proportional anion adjustment':
        arg_11 = -arg_10/arg_9
        arg_7 = [i*arg_11 for i in arg_7]
    else:
        raise Exception('Allowable methods are %s' %charge_balance_methods)
    arg_12 = 1. - sum(arg_7) - sum(arg_8)
    return arg_7, arg_8, arg_12


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func permittivity of a liquid at temperature `T`
        with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func relative permittivity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        epsilon : float
            Relative permittivity of the liquid at T, [-]
        '''
        if arg_2 == CRC:
            arg_3, arg_4, arg_5, arg_6 = arg_0.CRC_coeffs
            arg_7 = arg_3 + arg_4*arg_1 + arg_5*arg_1**2 + arg_6*arg_1**3
        elif arg_2 == CRC_CONSTANT:
            arg_7 = arg_0.CRC_permittivity
        elif arg_2 in arg_0.tabular_data:
            arg_7 = arg_0.interpolate(arg_1, arg_2)
        return arg_7


def Func():
    '''Data is stored in the format
    InChI key\tbool bool bool \tsubgroup count ...\tsubgroup count \tsubgroup count...
    where the bools refer to whether or not the original UNIFAC, modified
    UNIFAC, and PSRK group assignments were completed correctly.
    The subgroups and their count have an indefinite length.
    '''
    # Do not allow running multiple times
    if DDBST_UNIFAC_assignments:
        return None
    with open(os.path.join(folder, 'DDBST UNIFAC assignments.tsv')) as f:
        arg_0 = [DDBST_UNIFAC_assignments, DDBST_MODIFIED_UNIFAC_assignments, DDBST_PSRK_assignments]
        for arg_1 in f.readlines():
            arg_2, arg_3, arg_4, arg_5, arg_6 = arg_1.split('\t')
            # list of whether or not each method was correctly identified or not
            arg_3 = [True if arg_11 == '1' else False for arg_11 in arg_3.split(' ')]
            for arg_7, arg_8, arg_9 in zip([arg_4, arg_5, arg_6], arg_0, arg_3):
                if arg_9:
                    arg_7 = arg_7.rstrip().split(' ')
                    arg_10 = {}
                    for arg_11 in range(arg_12(len(arg_7)/2)):
                        arg_10[arg_12(arg_7[arg_11*2])] = arg_12(arg_7[arg_11*2+1])
                    arg_8[arg_2] = arg_10


def Func(arg_0, arg_1=False, arg_2=None):
    r'''This function handles the retrieval of a chemical's dipole moment.
    Lookup is based on CASRNs. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'CCCBDB'. Considerable variation in reported data has
    found.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    dipole : float
        Dipole moment, [debye]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain dipole moment with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'CCCBDB', 'MULLER', or
        'POLING'. All valid values are also held in the list `dipole_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the dipole moment for the desired chemical, and will return methods
        instead of the dipole moment

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'CCCBDB', a series of critically evaluated data for compounds in
          [1]_, intended for use in predictive modeling.
        * 'MULLER', a collection of data in a
          group-contribution scheme in [2]_.
        * 'POLING', in the appendix in [3].

    This function returns dipole moment in units of Debye. This is actually
    a non-SI unit; to convert to SI, multiply by 3.33564095198e-30 and its
    units will be in ampere*second^2 or equivalently and more commonly given,
    coulomb*second. The constant is the result of 1E-21/c, where c is the
    speed of light.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    1.44

    References
    ----------
    .. [1] NIST Computational Chemistry Comparison and Benchmark Database
       NIST Standard Reference Database Number 101 Release 17b, September 2015,
       Editor: Russell D. Johnson III http://cccbdb.nist.gov/
    .. [2] Muller, Karsten, Liudmila Mokrushina, and Wolfgang Arlt. "Second-
       Order Group Contribution Method for the Determination of the Dipole
       Moment." Journal of Chemical & Engineering Data 57, no. 4 (April 12,
       2012): 1231-36. doi:10.1021/je2013395.
    .. [3] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition.
       New York: McGraw-Hill Professional, 2000.
    '''
    def list_methods():
        arg_3 = []
        if arg_0 in _dipole_CCDB.index and not np.isnan(_dipole_CCDB.at[arg_0, 'Dipole']):
            arg_3.append(CCCBDB)
        if arg_0 in _dipole_Muller.index and not np.isnan(_dipole_Muller.at[arg_0, 'Dipole']):
            arg_3.append(MULLER)
        if arg_0 in _dipole_Poling.index and not np.isnan(_dipole_Poling.at[arg_0, 'Dipole']):
            arg_3.append(POLING)
        arg_3.append(NONE)
        return arg_3
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == CCCBDB:
        arg_4 = float(_dipole_CCDB.at[arg_0, 'Dipole'])
    elif arg_2 == MULLER:
        arg_4 = float(_dipole_Muller.at[arg_0, 'Dipole'])
    elif arg_2 == POLING:
        arg_4 = float(_dipole_Poling.at[arg_0, 'Dipole'])
    elif arg_2 == NONE:
        arg_4 = None
    else:
        raise Exception('Failure in in function')
    return arg_4


def Func(arg_0, arg_1=False, arg_2=None, arg_3=[arg_4]):
    r'''This function handles the retrieval of a chemical's critical
    pressure. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    6137000.0

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Critical pressure, [Pa]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'PD', 'YAWS', and 'SURF'. All valid values are also held
        in the list `Func_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of seven sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'PD', an older compillation of
          data published in [16]_
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [17]_.
        * SURF', an estimation method using a
          simple quadratic method for estimating Func from Tc and Vc. This is
          ignored and not returned as a method by default.

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Passut, Charles A., and Ronald P. Danner. "Acentric Factor. A
       Valuable Correlating Parameter for the Properties of Hydrocarbons."
       Industrial & Engineering Chemistry Process Design and Development 12,
       no. 3 (July 1, 1973): 365–68. doi:10.1021/i260047a026.
    .. [17] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    def list_methods():
        arg_5 = []
        if arg_0 in _crit_IUPAC.index and not np.isnan(_crit_IUPAC.at[arg_0, 'Func']):
            arg_5.append(IUPAC)
        if arg_0 in _crit_Matthews.index and not np.isnan(_crit_Matthews.at[arg_0, 'Func']):
            arg_5.append(MATTHEWS)
        if arg_0 in _crit_CRC.index and not np.isnan(_crit_CRC.at[arg_0, 'Func']):
            arg_5.append(CRC)
        if arg_0 in _crit_PSRKR4.index and not np.isnan(_crit_PSRKR4.at[arg_0, 'Func']):
            arg_5.append(PSRK)
        if arg_0 in _crit_PassutDanner.index and not np.isnan(_crit_PassutDanner.at[arg_0, 'Func']):
            arg_5.append(PD)
        if arg_0 in _crit_Yaws.index and not np.isnan(_crit_Yaws.at[arg_0, 'Func']):
            arg_5.append(YAWS)
        if arg_0:
            arg_5.append(arg_4)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_5:
                    arg_5.remove(arg_2)
        arg_5.append(NONE)
        return arg_5
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == IUPAC:
        arg_6 = float(_crit_IUPAC.at[arg_0, 'Func'])
    elif arg_2 == MATTHEWS:
        arg_6 = float(_crit_Matthews.at[arg_0, 'Func'])
    elif arg_2 == CRC:
        arg_6 = float(_crit_CRC.at[arg_0, 'Func'])
    elif arg_2 == PSRK:
        arg_6 = float(_crit_PSRKR4.at[arg_0, 'Func'])
    elif arg_2 == PD:
        arg_6 = float(_crit_PassutDanner.at[arg_0, 'Func'])
    elif arg_2 == YAWS:
        arg_6 = float(_crit_Yaws.at[arg_0, 'Func'])
    elif arg_2 == arg_4:
        arg_6 = third_property(arg_0=arg_0, P=True)
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')
    return arg_6


def Func(arg_0, arg_1=False, arg_2=None, arg_3=[arg_4]):
    r'''This function handles the retrieval of a chemical's critical
    volume. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    0.000168

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Critical volume, [m^3/mol]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'YAWS', and 'SURF'. All valid values are also held
        in the list `Func_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of six sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [16]_.
        * 'SURF', an estimation method using a
          simple quadratic method for estimating Pc from Tc and Func. This is
          ignored and not returned as a method by default

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    def list_methods():
        arg_5 = []
        if arg_0 in _crit_IUPAC.index and not np.isnan(_crit_IUPAC.at[arg_0, 'Func']):
            arg_5.append(IUPAC)
        if arg_0 in _crit_Matthews.index and not np.isnan(_crit_Matthews.at[arg_0, 'Func']):
            arg_5.append(MATTHEWS)
        if arg_0 in _crit_CRC.index and not np.isnan(_crit_CRC.at[arg_0, 'Func']):
            arg_5.append(CRC)
        if arg_0 in _crit_PSRKR4.index and not np.isnan(_crit_PSRKR4.at[arg_0, 'Func']):
            arg_5.append(PSRK)
        if arg_0 in _crit_Yaws.index and not np.isnan(_crit_Yaws.at[arg_0, 'Func']):
            arg_5.append(YAWS)
        if arg_0:
            arg_5.append(arg_4)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_5:
                    arg_5.remove(arg_2)
        arg_5.append(NONE)
        return arg_5
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == IUPAC:
        arg_6 = float(_crit_IUPAC.at[arg_0, 'Func'])
    elif arg_2 == PSRK:
        arg_6 = float(_crit_PSRKR4.at[arg_0, 'Func'])
    elif arg_2 == MATTHEWS:
        arg_6 = float(_crit_Matthews.at[arg_0, 'Func'])
    elif arg_2 == CRC:
        arg_6 = float(_crit_CRC.at[arg_0, 'Func'])
    elif arg_2 == YAWS:
        arg_6 = float(_crit_Yaws.at[arg_0, 'Func'])
    elif arg_2 == arg_4:
        arg_6 = third_property(arg_0=arg_0, V=True)
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')
    return arg_6


def Func(arg_0, arg_1=False, arg_2=None, arg_3=[arg_4]):
    r'''This function handles the retrieval of a chemical's critical
    compressibility. Lookup is based on CASRNs. Will automatically select a
    data source to use if no Method is provided; returns None if the data is
    not available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    0.24100000000000002

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Critical compressibility, [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Vc with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'YAWS', and 'COMBINED'. All valid values are also held
        in `Func_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of five sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [16]_.

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    def list_methods():
        arg_5 = []
        if arg_0 in _crit_IUPAC.index and not np.isnan(_crit_IUPAC.at[arg_0, 'Func']):
            arg_5.append(IUPAC)
        if arg_0 in _crit_Matthews.index and not np.isnan(_crit_Matthews.at[arg_0, 'Func']):
            arg_5.append(MATTHEWS)
        if arg_0 in _crit_CRC.index and not np.isnan(_crit_CRC.at[arg_0, 'Func']):
            arg_5.append(CRC)
        if arg_0 in _crit_PSRKR4.index and not np.isnan(_crit_PSRKR4.at[arg_0, 'Func']):
            arg_5.append(PSRK)
        if arg_0 in _crit_Yaws.index and not np.isnan(_crit_Yaws.at[arg_0, 'Func']):
            arg_5.append(YAWS)
        if Tc(arg_0) and Vc(arg_0) and Pc(arg_0):
            arg_5.append(arg_4)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_5:
                    arg_5.remove(arg_2)
        arg_5.append(NONE)
        return arg_5
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_2 == IUPAC:
        arg_6 = float(_crit_IUPAC.at[arg_0, 'Func'])
    elif arg_2 == PSRK:
        arg_6 = float(_crit_PSRKR4.at[arg_0, 'Func'])
    elif arg_2 == MATTHEWS:
        arg_6 = float(_crit_Matthews.at[arg_0, 'Func'])
    elif arg_2 == CRC:
        arg_6 = float(_crit_CRC.at[arg_0, 'Func'])
    elif arg_2 == YAWS:
        arg_6 = float(_crit_Yaws.at[arg_0, 'Func'])
    elif arg_2 == arg_4:
        arg_6 = Vc(arg_0)*Pc(arg_0)/Tc(arg_0)/R
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')
    return arg_6


def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=False,
                     arg_4=None):
    r'''Function for calculating a critical property of a substance from its
    other two critical properties. Calls functions Ihmels, Meissner, and
    Grigoras, each of which use a general 'Critical surface' type of equation.
    Limited accuracy is expected due to very limited theoretical backing.

    Parameters
    ----------
    Tc : float
        Critical temperature of fluid (optional) [K]
    Pc : float
        Critical pressure of fluid (optional) [Pa]
    Vc : float
        Critical volume of fluid (optional) [m^3/mol]
    AvailableMethods : bool
        Request available methods for given parameters
    Method : string
        Request calculation uses the requested method

    Returns
    -------
    Tc, Pc or Vc : float
        Critical property of fluid [K], [Pa], or [m^3/mol]

    Notes
    -----

    Examples
    --------
    Decamethyltetrasiloxane [141-62-8]

    >>> Func(Tc=599.4, Pc=1.19E6, Method='IHMELS')
    0.0010927333333333334
    '''
    def list_methods():
        arg_5 = []
        if (arg_0 and arg_1) or (arg_0 and arg_2) or (arg_1 and arg_2):
            arg_5.append(IHMELS)
            arg_5.append(MEISSNER)
            arg_5.append(GRIGORAS)
        arg_5.append(NONE)
        return arg_5
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_4 == IHMELS:
        arg_6 = Ihmels(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2)
    elif arg_4 == MEISSNER:
        arg_6 = Meissner(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2)
    elif arg_4 == GRIGORAS:
        arg_6 = Grigoras(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2)
    elif arg_4 == NONE:
        arg_6 = None
    else:
        raise Exception('Failure in in function')
    return arg_6


def Func(arg_0=None, arg_1=False, arg_2=False, arg_3=False):
    r'''Function for calculating a critical property of a substance from its
    other two critical properties, but retrieving the actual other critical
    values for convenient calculation.
    Calls functions Ihmels, Meissner, and
    Grigoras, each of which use a general 'Critical surface' type of equation.
    Limited accuracy is expected due to very limited theoretical backing.

    Parameters
    ----------
    CASRN : string
        The CAS number of the desired chemical
    T : bool
        Estimate critical temperature
    P : bool
        Estimate critical pressure
    V : bool
        Estimate critical volume

    Returns
    -------
    Tc, Pc or Vc : float
        Critical property of fluid [K], [Pa], or [m^3/mol]

    Notes
    -----
    Avoids recursion only by eliminating the None and critical surface options
    for calculating each critical property. So long as it never calls itself.
    Note that when used by Tc, Pc or Vc, this function results in said function
    calling the other functions (to determine methods) and (with method specified)

    Examples
    --------
    >>> # Decamethyltetrasiloxane [141-62-8]
    >>> Func('141-62-8', V=True)
    0.0010920041152263375

    >>> # Succinic acid 110-15-6
    >>> Func('110-15-6', P=True)
    6095016.233766234
    '''
    arg_4 = None
    if arg_3:
        arg_5 = Tc(arg_0, AvailableMethods=True)[0:-2]
        arg_6 = Pc(arg_0, AvailableMethods=True)[0:-2]
        if arg_5 and arg_6:
            arg_7 = Tc(arg_0=arg_0, Method=arg_5[0])
            arg_8 = Pc(arg_0=arg_0, Method=arg_6[0])
            arg_4 = critical_surface(Tc=arg_7, Pc=arg_8, Vc=None)
    elif arg_2:
        arg_5 = Tc(arg_0, AvailableMethods=True)[0:-2]
        arg_9 = Vc(arg_0, AvailableMethods=True)[0:-2]
        if arg_5 and arg_9:
            arg_7 = Tc(arg_0=arg_0, Method=arg_5[0])
            arg_10 = Vc(arg_0=arg_0, Method=arg_9[0])
            arg_4 = critical_surface(Tc=arg_7, Vc=arg_10, Pc=None)
    elif arg_1:
        arg_6 = Pc(arg_0, AvailableMethods=True)[0:-2]
        arg_9 = Vc(arg_0, AvailableMethods=True)[0:-2]
        if arg_6 and arg_9:
            arg_8 = Pc(arg_0=arg_0, Method=arg_6[0])
            arg_10 = Vc(arg_0=arg_0, Method=arg_9[0])
            arg_4 = critical_surface(Pc=arg_8, Vc=arg_10, Tc=None)
    else:
        raise Exception('Error in function')
    if not arg_4:
        return None
    return arg_4


def Func(arg_0):
    '''Checks if a CAS number is valid. Returns False if the parser cannot
    parse the given string..

    Parameters
    ----------
    CASRN : string
        A three-piece, dash-separated set of numbers

    Returns
    -------
    result : bool
        Boolean value if CASRN was valid. If parsing fails, return False also.

    Notes
    -----
    Check method is according to Chemical Abstract Society. However, no lookup
    to their service is performed; therefore, this function cannot detect
    false positives.

    Function also does not support additional separators, apart from '-'.

    CAS numbers up to the series 1 XXX XXX-XX-X are now being issued.

    A long can hold CAS numbers up to 2 147 483-64-7

    Examples
    --------
    >>> Func('7732-18-5')
    True
    >>> Func('77332-18-5')
    False
    '''
    try:
        arg_1 = arg_0[-1]
        arg_0 = arg_0[::-1][1:]
        arg_2 = 0
        arg_3 = 1
        for arg_4 in arg_0:
            if arg_4 == '-':
                pass
            else:
                arg_2 += arg_3*int(arg_4)
                arg_3 += 1
        return (arg_2 % 10 == int(arg_1))
    except:
        return False


def Func(arg_0):
        '''Charge of the species as an integer. Computed as a property as most
        species do not have a Func and so storing it would be a waste of
        memory.
        '''
        try:
            return arg_0._Func
        except AttributeError:
            arg_0._Func = Func_from_formula(arg_0.formula)
            return arg_0._Func


def Func(arg_0, arg_1):
        '''Loads a file with newline-separated integers representing which
        chemical should be kept in memory; ones not included are ignored.
        '''
        arg_0.restrict_identifiers = True
        arg_3 = set()
        with open(arg_1) as f:
            [arg_3.add(int(arg_4)) for arg_4 in f]
        arg_0.included_identifiers = arg_3


def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=None,
               arg_5='', arg_6=False, arg_7=None):
    r'''This function handles the retrieval or calculation a chemical's
    Func parameter. Values are available from one source with lookup
    based on CASRNs, or can be estimated from 7 CSP methods.
    Will automatically select a data source to use if no Method is provided;
    returns None if the data is not available.

    Prefered sources are 'Magalhães, Lito, Da Silva, and Silva (2013)' for
    common chemicals which had valies listed in that source, and the CSP method
    `Tee, Gotoh, and Stewart CSP with Tc, omega (1966)` for chemicals which
    don't.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    1291.41

    Parameters
    ----------
    Tm : float, optional
        Melting temperature of fluid [K]
    Tb : float, optional
        Boiling temperature of fluid [K]
    Tc : float, optional
        Critical temperature, [K]
    Zc : float, optional
        Critical compressibility, [-]
    omega : float, optional
        Acentric factor of compound, [-]
    CASRN : string, optional
        CASRN [-]

    Returns
    -------
    epsilon_k : float
        Lennard-Jones depth of potential-energy minimum over k, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain epsilon with the given
        inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        epsilon for the desired chemical, and will return methods instead of
        epsilon

    Notes
    -----
    These values are somewhat rough, as they attempt to pigeonhole a chemical
    into L-J behavior.

    The tabulated data is from [2]_, for 322 chemicals.

    References
    ----------
    .. [1] Bird, R. Byron, Warren E. Stewart, and Edwin N. Lightfoot.
       Transport Phenomena, Revised 2nd Edition. New York:
       John Wiley & Sons, Inc., 2006
    .. [2] Magalhães, Ana L., Patrícia F. Lito, Francisco A. Da Silva, and
       Carlos M. Silva. "Simple and Accurate Correlations for Diffusion
       Coefficients of Solutes in Liquids and Supercritical Fluids over Wide
       Ranges of Temperature and Density." The Journal of Supercritical Fluids
       76 (April 2013): 94-114. doi:10.1016/j.supflu.2013.02.002.
    '''
    def list_methods():
        arg_8 = []
        if arg_5 in MagalhaesLJ_data.index:
            arg_8.append(MAGALHAES)
        if arg_2 and arg_4:
            arg_8.append(TEEGOTOSTEWARD2)
        if arg_2:
            arg_8.append(FLYNN)
            arg_8.append(BSLC)
            arg_8.append(TEEGOTOSTEWARD1)
        if arg_1:
            arg_8.append(BSLB)
        if arg_0:
            arg_8.append(BSLM)
        if arg_2 and arg_3:
            arg_8.append(STIELTHODOS)
        arg_8.append(NONE)
        return arg_8
    if arg_6:
        return list_methods()
    if not arg_7:
        arg_7 = list_methods()[0]

    if arg_7 == FLYNN:
        arg_9 = epsilon_Flynn(arg_2)
    elif arg_7 == BSLC:
        arg_9 = epsilon_Bird_Stewart_Lightfoot_critical(arg_2)
    elif arg_7 == BSLB:
        arg_9 = epsilon_Bird_Stewart_Lightfoot_boiling(arg_1)
    elif arg_7 == BSLM:
        arg_9 = epsilon_Bird_Stewart_Lightfoot_melting(arg_0)
    elif arg_7 == STIELTHODOS:
        arg_9 = epsilon_Stiel_Thodos(arg_2, arg_3)
    elif arg_7 == TEEGOTOSTEWARD1:
        arg_9 = epsilon_Tee_Gotoh_Steward_1(arg_2)
    elif arg_7 == TEEGOTOSTEWARD2:
        arg_9 = epsilon_Tee_Gotoh_Steward_2(arg_2, arg_4)

    elif arg_7 == MAGALHAES:
        arg_9 = float(MagalhaesLJ_data.at[arg_5, "epsilon"])
    elif arg_7 == NONE:
        arg_9 = None
    else:
        raise Exception('Failure in in function')
    return arg_9


def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=None,
          arg_5=None, arg_6=None, arg_7='', arg_8=False, arg_9=None):
    r'''This function handles the retrieval or calculation a chemical's
    L-J molecular diameter. Values are available from one source with lookup
    based on CASRNs, or can be estimated from 9 CSP methods.
    Will automatically select a data source to use if no Method is provided;
    returns None if the data is not available.

    Prefered sources are 'Magalhães, Lito, Da Silva, and Silva (2013)' for
    common chemicals which had valies listed in that source, and the CSP method
    `Tee, Gotoh, and Stewart CSP with Tc, Pc, omega (1966)` for chemicals which
    don't.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    4.23738

    Parameters
    ----------
    Tc : float, optional
        Critical temperature, [K]
    Pc : float, optional
        Critical pressure, [Pa]
    Vc : float, optional
        Critical volume, [m^3/mol]
    Zc : float, optional
        Critical compressibility, [-]
    omega : float, optional
        Acentric factor of compound, [-]
    Vm : float, optional
        Molar volume of liquid at the melting point of the fluid [K]
    Vb : float, optional
        Molar volume of liquid at the boiling point of the fluid [K]
    CASRN : string, optional
        CASRN [-]

    Returns
    -------
    sigma : float
        Lennard-Jones molecular diameter, [Angstrom]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain epsilon with the given
        inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        sigma for the desired chemical, and will return methods instead of
        sigma

    Notes
    -----
    These values are somewhat rough, as they attempt to pigeonhole a chemical
    into L-J behavior.

    The tabulated data is from [2]_, for 322 chemicals.

    References
    ----------
    .. [1] Bird, R. Byron, Warren E. Stewart, and Edwin N. Lightfoot.
       Transport Phenomena, Revised 2nd Edition. New York:
       John Wiley & Sons, Inc., 2006
    .. [2] Magalhães, Ana L., Patrícia F. Lito, Francisco A. Da Silva, and
       Carlos M. Silva. "Simple and Accurate Correlations for Diffusion
       Coefficients of Solutes in Liquids and Supercritical Fluids over Wide
       Ranges of Temperature and Density." The Journal of Supercritical Fluids
       76 (April 2013): 94-114. doi:10.1016/j.supflu.2013.02.002.
    '''
    def list_methods():
        arg_10 = []
        if arg_7 in MagalhaesLJ_data.index:
            arg_10.append(MAGALHAES)
        if arg_0 and arg_1 and arg_4:
            arg_10.append(TEEGOTOSTEWARD4)
        if arg_0 and arg_1:
            arg_10.append(SILVALIUMACEDO)
            arg_10.append(BSLC2)
            arg_10.append(TEEGOTOSTEWARD3)
        if arg_2 and arg_3:
            arg_10.append(STIELTHODOSMD)
        if arg_2:
            arg_10.append(FLYNN)
            arg_10.append(BSLC1)
        if arg_6:
            arg_10.append(BSLB)
        if arg_5:
            arg_10.append(BSLM)
        arg_10.append(NONE)
        return arg_10

    if arg_8:
        return list_methods()
    if not arg_9:
        arg_9 = list_methods()[0]
    if arg_9 == FLYNN:
        arg_11 = sigma_Flynn(arg_2)
    elif arg_9 == BSLC1:
        arg_11 = sigma_Bird_Stewart_Lightfoot_critical_1(arg_2)
    elif arg_9 == BSLC2:
        arg_11 = sigma_Bird_Stewart_Lightfoot_critical_2(arg_0, arg_1)
    elif arg_9 == TEEGOTOSTEWARD3:
        arg_11 = sigma_Tee_Gotoh_Steward_1(arg_0, arg_1)
    elif arg_9 == SILVALIUMACEDO:
        arg_11 = sigma_Silva_Liu_Macedo(arg_0, arg_1)
    elif arg_9 == BSLB:
        arg_11 = sigma_Bird_Stewart_Lightfoot_boiling(arg_6)
    elif arg_9 == BSLM:
        arg_11 = sigma_Bird_Stewart_Lightfoot_melting(arg_5)
    elif arg_9 == STIELTHODOSMD:
        arg_11 = sigma_Stiel_Thodos(arg_2, arg_3)
    elif arg_9 == TEEGOTOSTEWARD4:
        arg_11 = sigma_Tee_Gotoh_Steward_2(arg_0, arg_1, arg_4)
    elif arg_9 == MAGALHAES:
        arg_11 = float(MagalhaesLJ_data.at[arg_7, "sigma"])
    elif arg_9 == NONE:
        arg_11 = None
    else:
        raise Exception('Failure in in function')
    return arg_11