checks whether the parameter omega_m is within the given bounds
        :param omega_m:
        :param omega_m_min:
        :param omega_m_max:
        :return:
765170
def prior_omega_m(self, omega_m, omega_m_min=0, omega_m_max=1):
        
        if omega_m < omega_m_min or omega_m > omega_m_max:
            penalty = -10**15
            return penalty, False
        else:
            return 0, True
1320778
def calculate_iI_correspondence(omega):
    """
    Ne = len(omega[0])
    om = omega[0][0]
    correspondence = []
    I = 0
    for i in range(Ne):
        if omega[i][0] != om:
            om = omega[i][0]
            I += 1
        correspondence += [(i+1, I+1)]
    Nnd = I+1

    def I_nd(i):
        return correspondence[i-1][1]

    def i_d(I):
        for i in range(Ne):
            if correspondence[i][1] == I:
                return correspondence[i][0]

    return i_d, I_nd, Nnd
73272
def bound_bboxes(bboxes):
    
    group_x0 = min(map(lambda l: l[x0], bboxes))
    group_y0 = min(map(lambda l: l[y0], bboxes))
    group_x1 = max(map(lambda l: l[x1], bboxes))
    group_y1 = max(map(lambda l: l[y1], bboxes))
    return (group_x0, group_y0, group_x1, group_y1)
1133492
def between(self, min, max, limit=None, offset=None):
        
        if limit is not None and offset is None:
            offset = 0
        return self.zrangebyscore(min, max,
                start=offset, num=limit)
1129649
def inbounds(self, min, max):
        
        mincheck = sum(self.coordinates >= min, axis=1) == 0
        maxcheck = sum(self.coordinates < max, axis=1) == 0
        return True if (mincheck.sum() + maxcheck.sum()) == 0 else False
213897
private static boolean check(
            final double pXA, final double pYA, final double pXB, final double pYB,
            final double pXC, final double pYC, final double pXD, final double pYD,
            final PointL pIntersection,
            final double pXI, final double pYI
    ) {
        if (pXI < Math.min(pXA, pXB) || pXI > Math.max(pXA, pXB)) {
            return false;
        }
        if (pXI < Math.min(pXC, pXD) || pXI > Math.max(pXC, pXD)) {
            return false;
        }
        if (pYI < Math.min(pYA, pYB) || pYI > Math.max(pYA, pYB)) {
            return false;
        }
        if (pYI < Math.min(pYC, pYD) || pYI > Math.max(pYC, pYD)) {
            return false;
        }
        if (pIntersection != null) {
            pIntersection.x = Math.round(pXI);
            pIntersection.y = Math.round(pYI);
        }
        return true;
    }
989806
private void calcMinMax() throws IOException {
        hasMin = false;
        hasMax = false;
        if (excluded != null) {
            for (int i = 0; i < excluded.size(); i++) {
                GeneralSubtree subtree = excluded.get(i);
                if (subtree.getMinimum() != 0)
                    hasMin = true;
                if (subtree.getMaximum() != -1)
                    hasMax = true;
            }
        }

        if (permitted != null) {
            for (int i = 0; i < permitted.size(); i++) {
                GeneralSubtree subtree = permitted.get(i);
                if (subtree.getMinimum() != 0)
                    hasMin = true;
                if (subtree.getMaximum() != -1)
                    hasMax = true;
            }
        }
        minMaxValid = true;
    }
1075067
def is_valid_boundaries(self, boundaries):
        """"""
        if boundaries is not None:
            min_ = boundaries[0]
            for value in boundaries:
                if value < min_:
                    return False
                else:
                    min_ = value
            return True
        return False
148280
def minimum(self, value):
        
        self._remove_min()
        if value is None:
            return
        self._add_min(val=value)
1185128
def get_min_max_bounds(self):
        
        bound = Bound(999999.0, 0.0)
        for bp in Breakpoint:
            bound.extend(self.get_bound(bp))
        return {'min': bound.min, 'max': bound.max}
1167800
def _param_bounds(self, gamma, q):
        
        if gamma < 1.4:
            gamma = 1.4
        if gamma > 2.9:
            gamma = 2.9
        if q < 0.01:
            q = 0.01
        return float(gamma), q
1328127
def omega(imps):
    
    if isinstance(imps,v_Us_dict):
        return sum([omega(V) for U,V in imps.items()])#|V|=1
    if isinstance(imps,list):
        return sum([omega(x) for x in imps])
    if isinstance(imps,str):
        #imps = due[-1]
        try:
            U,V = imps.split("->")
            Us = U.split(",") if "," in U else U.split()
            Vs = V.split(",") if "," in V else V.split()
            res = len(Us)*len(Vs)
            return res
        except:
            return 0
    if isinstance(imps,int):
        b=bin(imps)[2:]
        res = len([x for x in b if x=='1'])
        return res
502109
def GetMinimum(self, expression, cut=None):
        
        if cut:
            self.Draw(expression, cut, "goff")
        else:
            self.Draw(expression, "", "goff")
        vals = self.GetV1()
        n = self.GetSelectedRows()
        vals = [vals[i] for i in range(min(n, 10000))]
        return min(vals)
86438
def motor_primitive(self, m):
        
        return bounds_min_max(m, self.conf.m_mins, self.conf.m_maxs)
94898
def get_minimum(self):
        '''
        
        '''
        return (self._min_value_t1, self._min_value_t2,
                self._min_value,    self._min_value_data)
931474
def constrain (n, min, max):

    ''' '''

    if n < min:
        return min
    if n > max:
        return max
    return n
517230
def bounds(self):
        
        return [scipy.stats.norm.interval(self.i, loc=m, scale=s) for s, m in zip(self.sigma, self.mu)]