Returns a list of 2-tuples, e.g. [(-3.14, 3.14), (-0.001, 0.001)],
        one tuple per parameter, giving min and max for that parameter.
168885
def getSensorLimits(self):
        
        limits = []
        for i in range(len([b for b in self.env.case.buses if b.type == PQ])):
            limits.append((0.0, self.env._Pd0[i]))

        logger.info("Sensor limits: %s" % limits)

        return limits
790897
def get_min(self,*args,**kwargs):
        
        if len(args) == 1:
            return self.spike_times.get_label(args[0]).min
        return [self.spike_times.get_label(a).max for a in args]
648375
def get_3_tuple_list(self,obj,default=None):
        
        if is_sequence2(obj):
            return [self.get_3_tuple(o,default) for o in obj]
        elif is_sequence(obj):
            return [self.get_3_tuple(obj[i:i+3],default) for i in range(0,len(obj),3)]
        else:
            return [self.get_3_tuple(obj,default)]
452273
public static <T1, T2, T3> Tuple3<T1, T2, T3> tuple(T1 v1, T2 v2, T3 v3) {
        return new Tuple3<>(v1, v2, v3);
    }
141517
def get_min_max_mag(self):
        
        m1s, m2s = [], []
        for mfd in self:
            m1, m2 = mfd.get_min_max_mag()
            m1s.append(m1)
            m2s.append(m2)
        return min(m1s), max(m2s)
311238
def p_param_types(self, p):
        ''''''
        if len(p) == 2:
            p[0] = tuple((t,) for t in p[1])
        elif len(p) == 3:
            p[0] = tuple((t,) for t in p[1]) + ((),)
        elif len(p) == 4:
            p[0] = tuple((t,) + ts for t in p[1] for ts in p[3])
        else:
            non_defaults = [t for t in p[4] if len(t) == len(p[4][0])]
            p[0] = tuple((t,) + ts for t in p[1] for ts in non_defaults) + p[4]
1049119
def get_temp_min_and_max(wxlist: [str]) -> ([str], str, str):  # type: ignore
    
    temp_max, temp_min = '', ''
    for i, item in reversed(list(enumerate(wxlist))):
        if len(item) > 6 and item[0] == 'T' and '/' in item:
            # TX12/1316Z
            if item[1] == 'X':
                temp_max = wxlist.pop(i)
            # TNM03/1404Z
            elif item[1] == 'N':
                temp_min = wxlist.pop(i)
            # TM03/1404Z T12/1316Z -> Will fix TN/TX
            elif item[1] == 'M' or item[1].isdigit():
                if temp_min:
                    if int(temp_min[2:temp_min.find('/')].replace('M', '-')) \
                            > int(item[1:item.find('/')].replace('M', '-')):
                        temp_max = 'TX' + temp_min[2:]
                        temp_min = 'TN' + item[1:]
                    else:
                        temp_max = 'TX' + item[1:]
                else:
                    temp_min = 'TN' + item[1:]
                wxlist.pop(i)
    return wxlist, temp_max, temp_min
348359
def sub(v1, v2):
    '''
    '''
    return tuple(a - b for a, b in zip(v1, v2))
14744
def _min(self):
        """"""
        return (
            self.range[0] if (self.range and self.range[0] is not None) else
            (min(self._values) if self._values else None)
        )
630411
public static double[] range2Bins( double min, double max, int binsNum ) {
        double delta = (max - min) / binsNum;
        double[] bins = new double[binsNum + 1];
        int count = 0;
        double running = min;
        for( int i = 0; i < binsNum; i++ ) {
            bins[count] = running;
            running = running + delta;
            count++;
        }
        bins[binsNum] = max;
        return bins;
    }
743249
def subtract_params(param_list_left, param_list_right):
    
    res = []
    for x, y in zip(param_list_left, param_list_right):
        res.append(x - y)
    return res
785062
public final Tuple2<Tuple2<T1, T2>, Tuple3<T3, T4, T5>> split2() {
        return new Tuple2<>(limit2(), skip2());
    }
887138
def closest_values(L):
    
    assert len(L) >= 2
    L.sort()
    valmin, argmin = min((L[i] - L[i - 1], i) for i in range(1, len(L)))
    return L[argmin - 1], L[argmin]
744806
def peaks(samples):
    
    max_index = numpy.argmax(samples)
    max_value = samples[max_index]

    min_index = numpy.argmin(samples)
    min_value = samples[min_index]

    if min_index < max_index:
        return (min_value, max_value)
    else:
        return (max_value, min_value)
1216258
@SuppressWarnings("unchecked")
    public static <T1, T2> Tuple2<T1, T2>[] zip(T1[] arr1, T2[] arr2) {
        int resultSize = _max(arr1.length, arr2.length);
        Tuple2[] result = new Tuple2[resultSize];

        for (int i = 0; i < resultSize; i++)
            result[i] = tuple(next(arr1, i), next(arr2, i));

        return result;
    }
1043152
def minimum(x1, x2, output_shape=None, name=None):
  
  output_shape = convert_to_shape(output_shape)
  with tf.name_scope(name, default_name="minimum"):
    x1, x2 = binary_arguments_to_tensors(x1, x2)
    return MinMaxOperation(
        tf.minimum, x1, x2, output_shape=_infer_binary_broadcast_shape(
            x1.shape, x2.shape, output_shape)).outputs[0]
741430
def scale_values(numbers, num_lines=1, minimum=None, maximum=None):
    ""

    # find min/max values, ignoring Nones
    filtered = [n for n in numbers if n is not None]
    min_ = min(filtered) if minimum is None else minimum
    max_ = max(filtered) if maximum is None else maximum
    dv = max_ - min_

    # clamp
    numbers = [max(min(n, max_), min_) if n is not None else None for n in numbers]

    if dv == 0:
        values = [4 * num_lines if x is not None else None for x in numbers]
    elif dv > 0:
        num_blocks = len(blocks) - 1

        min_index = 1.
        max_index = num_lines * num_blocks

        values = [
            ((max_index - min_index) * (x - min_)) / dv + min_index
            if not x is None else None for x in numbers
        ]

        values = [round(v) or 1 if not v is None else None for v in values]
    return values