def METHOD_NAME(counts, bias_corrected=True):
    r"""Calculate chao1 richness estimator.
    Uses the bias-corrected version unless `bias_corrected` is ``False`` *and*
    there are both singletons and doubletons.
    Parameters
    ----------
    counts : 1-D array_like, int
        Vector of counts.
    bias_corrected : bool, optional
        Indicates whether or not to use the bias-corrected version of the
        equation. If ``False`` *and* there are both singletons and doubletons,
        the uncorrected version will be used. The biased-corrected version will
        be used otherwise.
    Returns
    -------
    double
        Computed chao1 richness estimator.
    See Also
    --------
    chao1_ci
    Notes
    -----
    The uncorrected version is based on Equation 6 in [1]_:
    .. math::
       chao1=S_{obs}+\frac{F_1^2}{2F_2}
    where :math:`F_1` and :math:`F_2` are the count of singletons and
    doubletons, respectively.
    The bias-corrected version is defined as
    .. math::
       chao1=S_{obs}+\frac{F_1(F_1-1)}{2(F_2+1)}
    References
    ----------
    .. [1] Chao, A. 1984. Non-parametric estimation of the number of classes in
       a population. Scandinavian Journal of Statistics 11, 265-270.
    """
    counts = _validate_counts_vector(counts)
    o, s, d = osd(counts)
    if not bias_corrected and s and d:
        return o + s ** 2 / (d * 2)
    else:
        return o + s * (s - 1) / (2 * (d + 1))