<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def convert_effsize(ef, input_type, output_type, nx=None, ny=None):
 """Conversion between effect sizes. Parameters ef : float Original effect size input_type : string Effect size type of ef. Must be 'r' or 'd'. output_type : string Desired effect size type. Available methods are :: 'none' : no effect size 'cohen' : Unbiased Cohen d 'hedges' : Hedges g 'glass': Glass delta 'eta-square' : Eta-square 'odds-ratio' : Odds ratio 'AUC' : Area Under the Curve nx, ny : int, optional Length of vector x and y. nx and ny are required to convert to Hedges g Returns ------- ef : float Desired converted effect size See Also -------- compute_effsize : Calculate effect size between two set of observations. compute_effsize_from_t : Convert a T-statistic to an effect size. Notes ----- The formula to convert **r** to **d** is given in ref [1]: .. math:: d = \\frac{2r}{\\sqrt{1 - r^2}} The formula to convert **d** to **r** is given in ref [2]: .. math:: r = \\frac{d}{\\sqrt{d^2 + \\frac{(n_x + n_y)^2 - 2(n_x + n_y)} {n_xn_y}}} The formula to convert **d** to :math:`\\eta^2` is given in ref [3]: .. math:: \\eta^2 = \\frac{(0.5 * d)^2}{1 + (0.5 * d)^2} The formula to convert **d** to an odds-ratio is given in ref [4]: .. math:: OR = e(\\frac{d * \\pi}{\\sqrt{3}}) The formula to convert **d** to area under the curve is given in ref [5]: .. math:: AUC = \\mathcal{N}_{cdf}(\\frac{d}{\\sqrt{2}}) References .. [1] Rosenthal, Robert. "Parametric measures of effect size." The handbook of research synthesis 621 (1994):
 231-244. .. [2] McGrath, Robert E., and Gregory J. Meyer. "When effect sizes disagree: the case of r and d." Psychological methods 11.4 (2006):
 386. .. [3] Cohen, Jacob. "Statistical power analysis for the behavioral sciences. 2nd." (1988). .. [4] Borenstein, Michael, et al. "Effect sizes for continuous data." The handbook of research synthesis and meta-analysis 2 (2009):
 221-235. .. [5] Ruscio, John. "A probability-based measure of effect size: Robustness to base rates and other factors." Psychological methods 1 3.1 (2008):
 19. Examples -------- 1. Convert from Cohen d to eta-square 0.048185603807257595 2. Convert from Cohen d to Hegdes g (requires the sample sizes of each group) 0.4309859154929578 3. Convert Pearson r to Cohen d 0.8728715609439696 4. Reverse operation: convert Cohen d to Pearson r 0.40004943911648533 """

    it = input_type.lower()
    ot = output_type.lower()

    # Check input and output type
    for input in [it, ot]:
        if not _check_eftype(input):
            err = "Could not interpret input '{}'".format(input)
            raise ValueError(err)
    if it not in ['r', 'cohen']:
        raise ValueError("Input type must be 'r' or 'cohen'")

    if it == ot:
        return ef

    d = (2 * ef) / np.sqrt(1 - ef**2) if it == 'r' else ef  # Rosenthal 1994

    # Then convert to the desired output type
    if ot == 'cohen':
        return d
    elif ot == 'hedges':
        if all(v is not None for v in [nx, ny]):
            return d * (1 - (3 / (4 * (nx + ny) - 9)))
        else:
            # If shapes of x and y are not known, return cohen's d
            warnings.warn("You need to pass nx and ny arguments to compute "
                          "Hedges g. Returning Cohen's d instead")
            return d
    elif ot == 'glass':
        warnings.warn("Returning original effect size instead of Glass "
                      "because variance is not known.")
        return ef
    elif ot == 'r':
        # McGrath and Meyer 2006
        if all(v is not None for v in [nx, ny]):
            a = ((nx + ny)**2 - 2 * (nx + ny)) / (nx * ny)
        else:
            a = 4
        return d / np.sqrt(d**2 + a)
    elif ot == 'eta-square':
        # Cohen 1988
        return (d / 2)**2 / (1 + (d / 2)**2)
    elif ot == 'odds-ratio':
        # Borenstein et al. 2009
        return np.exp(d * np.pi / np.sqrt(3))
    elif ot in ['auc', 'cles']:
        # Ruscio 2008
        from scipy.stats import norm
        return norm.cdf(d / np.sqrt(2))
    else:
        return None