<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _bivariate_handler(df, x, y=None, w=None, inplace=True, pvalue='sim', outvals=None, **kwargs):
 """ Compute a descriptive bivariate statistic over two sets of columns, `x` and `y`, contained in `df`. Parameters df : pandas.DataFrame dataframe in which columns `x` and `y` are contained x : string or list of strings one or more column names to use as variates in the bivariate statistics y : string or list of strings one or more column names to use as variates in the bivariate statistics w : pysal.weights.W spatial weights object corresponding to the dataframe `df` inplace : bool a flag denoting whether to add the statistic to the dataframe in memory, or to construct a copy of the dataframe and append the results to the copy pvalue : string the name of the pvalue on the results object wanted outvals : list of strings names of attributes of the dataframe to attempt to flatten into a column swapname : string suffix to replace generic identifier with. Each caller of this function should set this to a unique column suffix **kwargs : optional keyword arguments options that are passed directly to the statistic """

    real_swapname = kwargs.pop('swapname', '')
    if isinstance(y, str):
        y = [y]
    if isinstance(x, str):
        x = [x]
    if not inplace:
        new_df = df.copy()
        _bivariate_handler(new_df, x, y=y, w=w, inplace=True,
                           swapname=real_swapname,
                           pvalue=pvalue, outvals=outvals, **kwargs)
        return new_df
    if y is None:
        y = x
    for xi,yi in _it.product(x,y):
        if xi == yi:
            continue
        _univariate_handler(df, cols=xi, w=w, y=df[yi], inplace=True,
                            pvalue=pvalue, outvals=outvals, swapname='', **kwargs)
    if real_swapname is not '':
        df.columns = [_swap_ending(col, real_swapname)
                      if col.endswith('_statistic')
                      else col for col in df.columns]