Sum of top q passowrd frequencies
977953
def sumvalues(self, q=0):
        
        if q == 0:
            return self._totalf
        else:
            return -np.partition(-self._freq_list, q)[:q].sum()
823483
def _kl_divergence(self, summary_freq, doc_freq):
        
        sum_val = 0
        for w in summary_freq:
            frequency = doc_freq.get(w)
            if frequency:  # missing or zero = no frequency
                sum_val += frequency * math.log(frequency / summary_freq[w])

        return sum_val
1269156
def lowpass(self, frequency, q=0.707):
        
        self.command.append('lowpass')
        self.command.append(frequency)
        self.command.append(str(q) + 'q')
        return self
1291184
def find_Note(data, freq, bits):
    """"""
    data = find_frequencies(data, freq, bits)
    return sorted(find_notes(data), key=operator.itemgetter(1))[-1][0]
574318
function (start, end) {
    var total = 0;

    start = start || 0;
    end = end || this.binCount;

    for (var i = start; i < end; i++) {
      total += this.frequencyByteData[i];
    }

    return total / (end - start);
  }
25483
def dBinaryRochedr (r, D, q, F):
    

    r2 = (r*r).sum()
    r1 = np.sqrt(r2)

    return -1./r2 - q*(r1-r[0]/r1*D)/((r[0]-D)*(r[0]-D)+r[1]*r[1]+r[2]*r[2])**1.5 - q*r[0]/r1/D/D + F*F*(1+q)*(1-r[2]*r[2]/r2)*r1
422358
function sumsqr(values) {
      var _sumsqr = 0;
      for (var i = 0, len = values.length; i < len; i++) {
        var num = values[i];
        _sumsqr += (num * num);
      }
      return _sumsqr;
    }
100830
def frequency

      return brute_frequency unless @seconds && @seconds.length > 1

      secs = toa(@seconds)

      secs[1..-1].inject([ secs[0], 60 ]) { |(prev, delta), sec|
        d = sec - prev
        [ sec, d < delta ? d : delta ]
      }[1]
    end
326530
def __tdfs(j, k, head, next, post, stack):
    
    top = 0
    stack[0] = j
    while (top >= 0):
        p = stack[top]
        i = head[p]
        if i == -1:
            top -= 1
            post[k] = p
            k += 1
        else:
            head[p] = next[i]
            top += 1
            stack[top] = i

    return k
1239796
private int trMedian5(int ISAd, int v1, int v2, int v3, int v4, int v5) {
        int t;
        if (SA[ISAd + SA[v2]] > SA[ISAd + SA[v3]]) {
            t = v2;
            v2 = v3;
            v3 = t;
        }
        if (SA[ISAd + SA[v4]] > SA[ISAd + SA[v5]]) {
            t = v4;
            v4 = v5;
            v5 = t;
        }
        if (SA[ISAd + SA[v2]] > SA[ISAd + SA[v4]]) {
            t = v2;
            v2 = v4;
            v4 = t;
            t = v3;
            v3 = v5;
            v5 = t;
        }
        if (SA[ISAd + SA[v1]] > SA[ISAd + SA[v3]]) {
            t = v1;
            v1 = v3;
            v3 = t;
        }
        if (SA[ISAd + SA[v1]] > SA[ISAd + SA[v4]]) {
            t = v1;
            v1 = v4;
            v4 = t;
            t = v3;
            v3 = v5;
            v5 = t;
        }
        if (SA[ISAd + SA[v3]] > SA[ISAd + SA[v4]]) {
            return v4;
        }
        return v3;
    }
261878
def bandreject(self, frequency, q=1.0):
        
        self.command.append('bandreject')
        self.command.append(frequency)
        self.command.append(str(q) + 'q')
        return self
144171
def col_frequencies(col, weights=None, gap_chars='-.'):
    """"""
    counts = col_counts(col, weights, gap_chars)
    # Reduce to frequencies
    scale = 1.0 / sum(counts.values())
    return dict((aa, cnt * scale) for aa, cnt in counts.iteritems())
960127
def median(data, freq_col=1):
    

    nr_data = _nr_data(data, freq_col)
    median_idx = nr_data / 2
    i = 0
    for d in data:
        i += d[freq_col]
        if i >= median_idx:
            return d
    raise Exception("??? median ???")
348541
def sum_coefs(self):
        """"""
        return numpy.sum(self.ar_coefs) + numpy.sum(self.ma_coefs)
866529
def dBinaryRochedy (r, D, q, F):
    
    return -r[1]*(r[0]*r[0]+r[1]*r[1]+r[2]*r[2])**-1.5 -q*r[1]*((r[0]-D)*(r[0]-D)+r[1]*r[1]+r[2]*r[2])**-1.5 + F*F*(1+q)*r[1]
684810
def cum_percentile(series,q):
    
    total = series.sum()
    cum_sum = series.cumsum()
    return sum(cum_sum < total*q)
1082340
def most_frequent(lst):
    
    lst = lst[:]
    highest_freq = 0
    most_freq = None

    for val in unique(lst):
        if lst.count(val) > highest_freq:
            most_freq = val
            highest_freq = lst.count(val)
            
    return most_freq