def coint(y0, y1, trend='c', method='aeg', maxlag=None, autolag='aic', return_results=None):
    'Test for no-cointegration of a univariate equation\n\n    The null hypothesis is no cointegration. Variables in y0 and y1 are\n    assumed to be integrated of order 1, I(1).\n\n    This uses the augmented Engle-Granger two-step cointegration test.\n    Constant or trend is included in 1st stage regression, i.e. in\n    cointegrating equation.\n\n    **Warning:** The autolag default has changed compared to statsmodels 0.8.\n    In 0.8 autolag was always None, no the keyword is used and defaults to\n    \'aic\'. Use `autolag=None` to avoid the lag search.\n\n    Parameters\n    ----------\n    y1 : array_like, 1d\n        first element in cointegrating vector\n    y2 : array_like\n        remaining elements in cointegrating vector\n    trend : str {\'c\', \'ct\'}\n        trend term included in regression for cointegrating equation\n        * \'c\' : constant\n        * \'ct\' : constant and linear trend\n        * also available quadratic trend \'ctt\', and no constant \'nc\'\n\n    method : string\n        currently only \'aeg\' for augmented Engle-Granger test is available.\n        default might change.\n    maxlag : None or int\n        keyword for `adfuller`, largest or given number of lags\n    autolag : string\n        keyword for `adfuller`, lag selection criterion.\n        * if None, then maxlag lags are used without lag search\n        * if \'AIC\' (default) or \'BIC\', then the number of lags is chosen\n          to minimize the corresponding information criterion\n        * \'t-stat\' based choice of maxlag.  Starts with maxlag and drops a\n          lag until the t-statistic on the last lag length is significant\n          using a 5%-sized test\n\n    return_results : bool\n        for future compatibility, currently only tuple available.\n        If True, then a results instance is returned. Otherwise, a tuple\n        with the test outcome is returned.\n        Set `return_results=False` to avoid future changes in return.\n\n\n    Returns\n    -------\n    coint_t : float\n        t-statistic of unit-root test on residuals\n    pvalue : float\n        MacKinnon\'s approximate, asymptotic p-value based on MacKinnon (1994)\n    crit_value : dict\n        Critical values for the test statistic at the 1 %, 5 %, and 10 %\n        levels based on regression curve. This depends on the number of\n        observations.\n\n    Notes\n    -----\n    The Null hypothesis is that there is no cointegration, the alternative\n    hypothesis is that there is cointegrating relationship. If the pvalue is\n    small, below a critical size, then we can reject the hypothesis that there\n    is no cointegrating relationship.\n\n    P-values and critical values are obtained through regression surface\n    approximation from MacKinnon 1994 and 2010.\n\n    If the two series are almost perfectly collinear, then computing the\n    test is numerically unstable. However, the two series will be cointegrated\n    under the maintained assumption that they are integrated. In this case\n    the t-statistic will be set to -inf and the pvalue to zero.\n\n    TODO: We could handle gaps in data by dropping rows with nans in the\n    auxiliary regressions. Not implemented yet, currently assumes no nans\n    and no gaps in time series.\n\n    References\n    ----------\n    MacKinnon, J.G. 1994  "Approximate Asymptotic Distribution Functions for\n        Unit-Root and Cointegration Tests." Journal of Business & Economics\n        Statistics, 12.2, 167-76.\n    MacKinnon, J.G. 2010.  "Critical Values for Cointegration Tests."\n        Queen\'s University, Dept of Economics Working Papers 1227.\n        http://ideas.repec.org/p/qed/wpaper/1227.html\n    '
    trend = trend.lower()
    if (trend not in ['c', 'nc', 'ct', 'ctt']):
        raise ValueError(('trend option %s not understood' % trend))
    y0 = np.asarray(y0)
    y1 = np.asarray(y1)
    if (y1.ndim < 2):
        y1 = y1[:, None]
    (nobs, k_vars) = y1.shape
    k_vars += 1
    if (trend == 'nc'):
        xx = y1
    else:
        xx = add_trend(y1, trend=trend, prepend=False)
    res_co = OLS(y0, xx).fit()
    if (res_co.rsquared < (1 - (100 * SQRTEPS))):
        res_adf = adfuller(res_co.resid, maxlag=maxlag, autolag=autolag, regression='nc')
    else:
        import warnings
        warnings.warn('y0 and y1 are (almost) perfectly colinear.Cointegration test is not reliable in this case.')
        res_adf = ((- np.inf),)
    if (trend == 'nc'):
        crit = ([np.nan] * 3)
    else:
        crit = mackinnoncrit(N=k_vars, regression=trend, nobs=(nobs - 1))
    pval_asy = mackinnonp(res_adf[0], regression=trend, N=k_vars)
    return (res_adf[0], pval_asy, crit)
Test for no-cointegration of a univariate equation

The null hypothesis is no cointegration. Variables in y0 and y1 are
assumed to be integrated of order 1, I(1).

This uses the augmented Engle-Granger two-step cointegration test.
Constant or trend is included in 1st stage regression, i.e. in
cointegrating equation.

**Warning:** The autolag default has changed compared to statsmodels 0.8.
In 0.8 autolag was always None, no the keyword is used and defaults to
'aic'. Use `autolag=None` to avoid the lag search.

Parameters
----------
y1 : array_like, 1d
    first element in cointegrating vector
y2 : array_like
    remaining elements in cointegrating vector
trend : str {'c', 'ct'}
    trend term included in regression for cointegrating equation
    * 'c' : constant
    * 'ct' : constant and linear trend
    * also available quadratic trend 'ctt', and no constant 'nc'

method : string
    currently only 'aeg' for augmented Engle-Granger test is available.
    default might change.
maxlag : None or int
    keyword for `adfuller`, largest or given number of lags
autolag : string
    keyword for `adfuller`, lag selection criterion.
    * if None, then maxlag lags are used without lag search
    * if 'AIC' (default) or 'BIC', then the number of lags is chosen
      to minimize the corresponding information criterion
    * 't-stat' based choice of maxlag.  Starts with maxlag and drops a
      lag until the t-statistic on the last lag length is significant
      using a 5%-sized test

return_results : bool
    for future compatibility, currently only tuple available.
    If True, then a results instance is returned. Otherwise, a tuple
    with the test outcome is returned.
    Set `return_results=False` to avoid future changes in return.


Returns
-------
coint_t : float
    t-statistic of unit-root test on residuals
pvalue : float
    MacKinnon's approximate, asymptotic p-value based on MacKinnon (1994)
crit_value : dict
    Critical values for the test statistic at the 1 %, 5 %, and 10 %
    levels based on regression curve. This depends on the number of
    observations.

Notes
-----
The Null hypothesis is that there is no cointegration, the alternative
hypothesis is that there is cointegrating relationship. If the pvalue is
small, below a critical size, then we can reject the hypothesis that there
is no cointegrating relationship.

P-values and critical values are obtained through regression surface
approximation from MacKinnon 1994 and 2010.

If the two series are almost perfectly collinear, then computing the
test is numerically unstable. However, the two series will be cointegrated
under the maintained assumption that they are integrated. In this case
the t-statistic will be set to -inf and the pvalue to zero.

TODO: We could handle gaps in data by dropping rows with nans in the
auxiliary regressions. Not implemented yet, currently assumes no nans
and no gaps in time series.

References
----------
MacKinnon, J.G. 1994  "Approximate Asymptotic Distribution Functions for
    Unit-Root and Cointegration Tests." Journal of Business & Economics
    Statistics, 12.2, 167-76.
MacKinnon, J.G. 2010.  "Critical Values for Cointegration Tests."
    Queen's University, Dept of Economics Working Papers 1227.
    http://ideas.repec.org/p/qed/wpaper/1227.html
def coint(y0, y1, trend='c', method='aeg', maxlag=None, autolag='aic', return_results=None):
    'Test for no-cointegration of a univariate equation\n\n    The null hypothesis is no cointegration. Variables in y0 and y1 are\n    assumed to be integrated of order 1, I(1).\n\n    This uses the augmented Engle-Granger two-step cointegration test.\n    Constant or trend is included in 1st stage regression, i.e. in\n    cointegrating equation.\n\n    **Warning:** The autolag default has changed compared to statsmodels 0.8.\n    In 0.8 autolag was always None, no the keyword is used and defaults to\n    \'aic\'. Use `autolag=None` to avoid the lag search.\n\n    Parameters\n    ----------\n    y1 : array_like, 1d\n        first element in cointegrating vector\n    y2 : array_like\n        remaining elements in cointegrating vector\n    trend : str {\'c\', \'ct\'}\n        trend term included in regression for cointegrating equation\n        * \'c\' : constant\n        * \'ct\' : constant and linear trend\n        * also available quadratic trend \'ctt\', and no constant \'nc\'\n\n    method : string\n        currently only \'aeg\' for augmented Engle-Granger test is available.\n        default might change.\n    maxlag : None or int\n        keyword for `adfuller`, largest or given number of lags\n    autolag : string\n        keyword for `adfuller`, lag selection criterion.\n        * if None, then maxlag lags are used without lag search\n        * if \'AIC\' (default) or \'BIC\', then the number of lags is chosen\n          to minimize the corresponding information criterion\n        * \'t-stat\' based choice of maxlag.  Starts with maxlag and drops a\n          lag until the t-statistic on the last lag length is significant\n          using a 5%-sized test\n\n    return_results : bool\n        for future compatibility, currently only tuple available.\n        If True, then a results instance is returned. Otherwise, a tuple\n        with the test outcome is returned.\n        Set `return_results=False` to avoid future changes in return.\n\n\n    Returns\n    -------\n    coint_t : float\n        t-statistic of unit-root test on residuals\n    pvalue : float\n        MacKinnon\'s approximate, asymptotic p-value based on MacKinnon (1994)\n    crit_value : dict\n        Critical values for the test statistic at the 1 %, 5 %, and 10 %\n        levels based on regression curve. This depends on the number of\n        observations.\n\n    Notes\n    -----\n    The Null hypothesis is that there is no cointegration, the alternative\n    hypothesis is that there is cointegrating relationship. If the pvalue is\n    small, below a critical size, then we can reject the hypothesis that there\n    is no cointegrating relationship.\n\n    P-values and critical values are obtained through regression surface\n    approximation from MacKinnon 1994 and 2010.\n\n    If the two series are almost perfectly collinear, then computing the\n    test is numerically unstable. However, the two series will be cointegrated\n    under the maintained assumption that they are integrated. In this case\n    the t-statistic will be set to -inf and the pvalue to zero.\n\n    TODO: We could handle gaps in data by dropping rows with nans in the\n    auxiliary regressions. Not implemented yet, currently assumes no nans\n    and no gaps in time series.\n\n    References\n    ----------\n    MacKinnon, J.G. 1994  "Approximate Asymptotic Distribution Functions for\n        Unit-Root and Cointegration Tests." Journal of Business & Economics\n        Statistics, 12.2, 167-76.\n    MacKinnon, J.G. 2010.  "Critical Values for Cointegration Tests."\n        Queen\'s University, Dept of Economics Working Papers 1227.\n        http://ideas.repec.org/p/qed/wpaper/1227.html\n    '
    trend = trend.lower()
    if (trend not in ['c', 'nc', 'ct', 'ctt']):
        raise ValueError(('trend option %s not understood' % trend))
    y0 = np.asarray(y0)
    y1 = np.asarray(y1)
    if (y1.ndim < 2):
        y1 = y1[:, None]
    (nobs, k_vars) = y1.shape
    k_vars += 1
    if (trend == 'nc'):
        xx = y1
    else:
        xx = add_trend(y1, trend=trend, prepend=False)
    res_co = OLS(y0, xx).fit()
    if (res_co.rsquared < (1 - (100 * SQRTEPS))):
        res_adf = adfuller(res_co.resid, maxlag=maxlag, autolag=autolag, regression='nc')
    else:
        import warnings
        warnings.warn('y0 and y1 are (almost) perfectly colinear.Cointegration test is not reliable in this case.')
        res_adf = ((- np.inf),)
    if (trend == 'nc'):
        crit = ([np.nan] * 3)
    else:
        crit = mackinnoncrit(N=k_vars, regression=trend, nobs=(nobs - 1))
    pval_asy = mackinnonp(res_adf[0], regression=trend, N=k_vars)
    return (res_adf[0], pval_asy, crit)