def _analyze_distr(self, d):
    '\n        Analyze the given distribution with von Mises bimodal fit.\n\n        The distribution is analyzed with both unimodal and bimodal fits, and a\n        decision about the number of modes is made by comparing the goodness of\n        fit. It is a quick but inaccurate way of estimating the number of modes.\n        Return preference, selectivity, goodness of fit for both modes, and the\n        estimated numer of modes, None if even the unimodal fit failed. If the\n        distribution is unimodal, values of the second mode are set to 0. The main\n        mode is always the one with the largest selectivity (von Mises bandwith).\n        '
    no1 = False
    f = self.fit_vm(d)
    if (self.fit_exit_code != 0):
        no1 = True
    (p, s, g) = f
    f2 = self.fit_v2m(d)
    if ((self.fit_exit_code != 0) or (f2[2] > self.worst_fit)):
        if (no1 or (f[(- 1)] > self.worst_fit)):
            return None
        return (p, s, g, 0, 0, 0, 1)
    (p1, s1, g1, p2, s2, g2) = f2
    if (g1 > g):
        return (p, s, g, 0, 0, 0, 1)
    if (s2 > s1):
        return (p2, s2, g2, p1, s1, g1, 2)
    return (p1, s1, g1, p2, s2, g2, 2)
Analyze the given distribution with von Mises bimodal fit.

The distribution is analyzed with both unimodal and bimodal fits, and a
decision about the number of modes is made by comparing the goodness of
fit. It is a quick but inaccurate way of estimating the number of modes.
Return preference, selectivity, goodness of fit for both modes, and the
estimated numer of modes, None if even the unimodal fit failed. If the
distribution is unimodal, values of the second mode are set to 0. The main
mode is always the one with the largest selectivity (von Mises bandwith).
def _analyze_distr(self, d):
    '\n        Analyze the given distribution with von Mises bimodal fit.\n\n        The distribution is analyzed with both unimodal and bimodal fits, and a\n        decision about the number of modes is made by comparing the goodness of\n        fit. It is a quick but inaccurate way of estimating the number of modes.\n        Return preference, selectivity, goodness of fit for both modes, and the\n        estimated numer of modes, None if even the unimodal fit failed. If the\n        distribution is unimodal, values of the second mode are set to 0. The main\n        mode is always the one with the largest selectivity (von Mises bandwith).\n        '
    no1 = False
    f = self.fit_vm(d)
    if (self.fit_exit_code != 0):
        no1 = True
    (p, s, g) = f
    f2 = self.fit_v2m(d)
    if ((self.fit_exit_code != 0) or (f2[2] > self.worst_fit)):
        if (no1 or (f[(- 1)] > self.worst_fit)):
            return None
        return (p, s, g, 0, 0, 0, 1)
    (p1, s1, g1, p2, s2, g2) = f2
    if (g1 > g):
        return (p, s, g, 0, 0, 0, 1)
    if (s2 > s1):
        return (p2, s2, g2, p1, s1, g1, 2)
    return (p1, s1, g1, p2, s2, g2, 2)