test getting all 20
502349
function getAllActors() {
      try {
        storeBeingTested.getList(test.list, {}, function (list, error) {
          if (typeof error != 'undefined') {
            callback(error);
            return;
          }
          test.shouldBeTrue(list._items.length == 20, '20');
          getTomHanks();
        });
      }
      catch (err) {
        callback(err);
      }
    }
942135
def search_all(self, limit=50, format='json'):
        ''' '''
        desired_limit = limit
        results = self._search(limit, format)
        limit = limit - len(results)
        while len(results) < desired_limit:
            more_results = self._search(limit, format)
            if not more_results:
                break
            results += more_results
            limit = limit - len(more_results)
            time.sleep(1)
        return results
1066382
def _reduce_22(val, _values, result)
 n = val[0]; result = n.count('.') > 0 ? n.to_f : n.to_i 
    result
end
238928
def run_all
      return pending_result unless test_paths?
      Guard::UI.info("Resetting", reset: true)
      do_run{ @runner.run(@test_paths) }
    end
1284523
def is20(msg):
    

    if allzeros(msg):
        return False

    d = hex2bin(data(msg))

    if d[0:8] != '00100000':
        return False

    cs = cs20(msg)

    if '#' in cs:
        return False

    return True
96142
function (partStatistics) {
        this.count += partStatistics.count;
        this.tested += partStatistics.tested;
        this.ignored += partStatistics.ignored;
    }
1164260
public int countAll(){
        checkTable();

        Cursor mCount = null;
        try {
            mCount = database.rawQuery("SELECT COUNT(*) FROM \"" + tableName + "\"", null);
            if (mCount.moveToNext()) {
                return mCount.getInt(1);
            }
        } finally {
            if (mCount != null) {
                mCount.close();
            }
        }
        return 0;
    }
1010126
def check_all(self, all_entries, *args, **kwargs):
        
        all_overlaps = 0
        while True:
            try:
                user_entries = all_entries.next()
            except StopIteration:
                return all_overlaps
            else:
                user_total_overlaps = self.check_entry(
                    user_entries, *args, **kwargs)
                all_overlaps += user_total_overlaps
329113
private function run() {
		$issues = [];
		$totalFiles = 0;
		$totalLines = 0;
		$filePath = $this->scanner->getCurrentFilePath();
		if (!$this->options->getOption('t') || in_array('syntax', $this->options->getOption('t'), true)) {
			$checkSyntax = true;
			$versionGood = $this->tests->getPHPVersion();
			if (!$versionGood) {
				$this->reporter->add("ERROR!  Syntax checking was selected and a PHP binary lower than 7.0.0-dev was specified.", 0, 1);
			}
		} else {
			$checkSyntax = false;
		}

		while (($lines = $this->scanner->scanNextFile()) !== false) {
			$totalFiles++;

			//Check syntax and assign a line to grab if needed.
			$grabLineNumber = null;
			$grabLine = null;
			if ($checkSyntax) {
				$syntax = $this->tests->checkSyntax($filePath);
				if (!isset($syntax['is_valid'])) {
					$grabLineNumber = $syntax['line'];
				}
			}

			foreach ($lines as $index => $line) {
				$lineNumber = $index + 1;
				$line = trim($line, "\r\n");

				if ($lineNumber == $grabLineNumber) {
					$grabLine = $line;
				}

				$totalLines++;
				$issues = $this->tests->testLine($line);
				foreach ($issues as $section => $tests) {
					foreach ($tests as $test => $true) {
						$this->reporter->addToSection($section, $test, $filePath, $lineNumber, $line);
					}
				}
			}

			if ($checkSyntax && $grabLine !== null) {
				$this->reporter->addToSection('syntax', 'syntax', $filePath, $grabLineNumber, $grabLine.' //'.$syntax['error']);
			}
			$filePath = $this->scanner->getCurrentFilePath();
		}
		$this->reporter->add("Processed {$totalLines} lines contained in {$totalFiles} files.", 0, 1);
	}
1261397
void pass_5(int fi, 
	      float in[],  int in0, int istride,
	      float out[], int out0, int ostride,
	      int sign, int product) {
    int k, k1;

    int factor = 5;
    int m = n / factor;
    int q = n / product;
    int p_1 = product / factor;
    int jump = (factor - 1) * p_1;

    float tau = (float)(Math.sqrt (5.0) / 4.0);
    float sin_2pi_by_5 =  (float)(sign * Math.sin (2.0 * PI / 5.0));
    float sin_2pi_by_10 = (float)(sign * Math.sin (2.0 * PI / 10.0));
    int i = in0, j = out0;
    int di = istride * m;
    int dj = ostride * p_1;
    float x_real, x_imag;
    for (k = 0; k < q; k++) {
      float twids[] = twiddle[fi][k];
      float w1_real =       twids[0];
      float w1_imag = -sign*twids[1];
      float w2_real =       twids[2];
      float w2_imag = -sign*twids[3];
      float w3_real =       twids[4];
      float w3_imag = -sign*twids[5];
      float w4_real =       twids[6];
      float w4_imag = -sign*twids[7];

      for (k1 = 0; k1 < p_1; k1++) {
	float z0_real = in[i];
	float z0_imag = in[i+1];
	float z1_real = in[i + di];
	float z1_imag = in[i + di+1];
	float z2_real = in[i + 2*di];
	float z2_imag = in[i + 2*di+1];
	float z3_real = in[i + 3*di];
	float z3_imag = in[i + 3*di+1];
	float z4_real = in[i + 4*di];
	float z4_imag = in[i + 4*di+1];
	i += istride;

	/* compute x = W(5) z */

	/* t1 = z1 + z4 */
	float t1_real = z1_real + z4_real;
	float t1_imag = z1_imag + z4_imag;
	  
	/* t2 = z2 + z3 */
	float t2_real = z2_real + z3_real;
	float t2_imag = z2_imag + z3_imag;
	  
	/* t3 = z1 - z4 */
	float t3_real = z1_real - z4_real;
	float t3_imag = z1_imag - z4_imag;
	  
	/* t4 = z2 - z3 */
	float t4_real = z2_real - z3_real;
	float t4_imag = z2_imag - z3_imag;
	  
	/* t5 = t1 + t2 */
	float t5_real = t1_real + t2_real;
	float t5_imag = t1_imag + t2_imag;
	  
	/* t6 = (sqrt(5)/4)(t1 - t2) */
	float t6_real = tau * (t1_real - t2_real);
	float t6_imag = tau * (t1_imag - t2_imag);
	  
	/* t7 = z0 - ((t5)/4) */
	float t7_real = z0_real - t5_real / 4.0f;
	float t7_imag = z0_imag - t5_imag / 4.0f;
	  
	/* t8 = t7 + t6 */
	float t8_real = t7_real + t6_real;
	float t8_imag = t7_imag + t6_imag;
	  
	/* t9 = t7 - t6 */
	float t9_real = t7_real - t6_real;
	float t9_imag = t7_imag - t6_imag;
	  
	/* t10 = sin(2 pi/5) t3 + sin(2 pi/10) t4 */
	float t10_real = sin_2pi_by_5 * t3_real + sin_2pi_by_10 * t4_real;
	float t10_imag = sin_2pi_by_5 * t3_imag + sin_2pi_by_10 * t4_imag;
	  
	/* t11 = sin(2 pi/10) t3 - sin(2 pi/5) t4 */
	float t11_real = sin_2pi_by_10 * t3_real - sin_2pi_by_5 * t4_real;
	float t11_imag = sin_2pi_by_10 * t3_imag - sin_2pi_by_5 * t4_imag;
      
	/* apply twiddle factors */
	  
	/* out0 = 1 * (z0 + t5) */
	out[j]   = z0_real + t5_real;
	out[j+1] = z0_imag + t5_imag;
	  
	/* out1 = w1 * (t8 + i t10) */
	x_real = t8_real - t10_imag;
	x_imag = t8_imag + t10_real;
	out[j + dj]   = w1_real * x_real - w1_imag * x_imag;
	out[j + dj+1] = w1_real * x_imag + w1_imag * x_real;
	  
	/* out2 = w2 * (t9 + i t11) */
	x_real = t9_real - t11_imag;
	x_imag = t9_imag + t11_real;
	out[j+2*dj]   = w2_real * x_real - w2_imag * x_imag;
	out[j+2*dj+1] = w2_real * x_imag + w2_imag * x_real;
	  
	/* out3 = w3 * (t9 - i t11) */
	x_real = t9_real + t11_imag;
	x_imag = t9_imag - t11_real;
	out[j+3*dj]   = w3_real * x_real - w3_imag * x_imag;
	out[j+3*dj+1] = w3_real * x_imag + w3_imag * x_real;
	  
	/* out4 = w4 * (t8 - i t10) */
	x_real = t8_real + t10_imag;
	x_imag = t8_imag - t10_real;
	out[j+4*dj]   = w4_real * x_real - w4_imag * x_imag;
	out[j+4*dj+1] = w4_real * x_imag + w4_imag * x_real;
	  
	j += ostride;
      }
      j += (factor - 1)*dj;
    }}
644547
def total(self):
        """"""
        if self._result_cache:
            return self._result_cache.total

        return self.all().total
659644
@Override
  public final void sample()
  {
    long totalCount = _totalCount.get();
    long lastTotal = _lastTotal;
    _lastTotal = totalCount;

    _value = totalCount - lastTotal;
  }
1057472
function get_tops($limit = 10, $xattr = '') {
        $ret = array();
        if (!$this->_txt) return false;
        $xmode = false;
        $attrs = array();
        if ($xattr != '') {
            if (substr($xattr, 0, 1) == '~') {
                $xattr = substr($xattr, 1);
                $xmode = true;
            }
            foreach (explode(',', $xattr) as $tmp) {
                $tmp = strtolower(trim($tmp));
                if (!empty($tmp)) $attrs[$tmp] = true;
            }
        }

        // save the old offset
        $off = $this->_off;
        $this->_off = $cnt = 0;
        $list = array();
        while ($tmpa = $this->get_result()) {
            foreach ($tmpa as $tmp) {
                $tmp['attr'] = trim($tmp['attr']);
                if ($tmp['idf'] < 0.2 || substr($tmp['attr'], 0, 1) == '#') continue;
                // check attr filter
                if (count($attrs) > 0) {
                    if ($xmode == true && isset($attrs[$tmp['attr']])) continue;
                    if ($xmode == false && !isset($attrs[$tmp['attr']])) continue;
                }
                // check stopwords
                $word = strtolower($tmp['word']);
                if ($this->_rule_checkbit($word, PSCWS4_RULE_NOSTATS)) continue;
                // put to list
                if (isset($list[$word])) {
                    $list[$word]['weight'] += $tmp['idf'];
                    $list[$word]['times']++;
                } else {
                    $list[$word] = array('word' => $tmp['word'], 'times' => 1, 'weight' => $tmp['idf'], 'attr' => $tmp['attr']);
                }
            }
        }
        // restore the offset
        $this->_off = $off;
        // sort it & return
        if ( (float)substr(PHP_VERSION, 0, 3) >= 5.3 ) {
            $cmp_func = function($a, $b) {return ($b['weight'] > $a['weight'] ? 1 : -1);};
        } else {
            $cmp_func = create_function('$a,$b', 'return ($b[\'weight\'] > $a[\'weight\'] ? 1 : -1);');
        }

        usort($list, $cmp_func);
        if (count($list) > $limit) $list = array_slice($list, 0, $limit);
        return $list;
    }
680916
def first(self):
        
        self.params['limit'] = 1
        result = self.all()
        return result.items[0] if result.total > 0 else None
701855
public int getNumObsFeats() {
        int count = 0;
        for (FactorTemplate ft : fts) {
            count += ft.getAlphabet().size();
        }
        return count;
    }
1323300
private int checkAndGetTotalCount() throws IllegalStateException {
		int usedBuckets = 0;
		int totalCount = buckets[0].getCount();
		for (int i = 1; i <= bucketNb; i++) {
			int bucketCount = buckets[i].getCount();
			totalCount += bucketCount;
			if (bucketCount > 0) {
				usedBuckets++;
			}
		}
		totalCount += buckets[bucketNb + 1].getCount();
		if (usedBuckets < 3) {
			throw new IllegalStateException("Only " + usedBuckets + " buckets used, not enough for interpolation, consider reconfiguring min/max/nb");
		}
		return totalCount;
	}
1291998
function getNumMatches(fileList, queryExpr) {
    var i,
        matches = 0;
    for (i = 0; i < fileList.length; i++) {
        var temp = countNumMatches(getFileContentsForFile(fileList[i]), queryExpr);
        if (temp) {
            numFiles++;
            matches += temp;
        }
        if (matches > MAX_TOTAL_RESULTS) {
            exceedsMaximum = true;
            break;
        }
    }
    return matches;
}