Useless to have collector without analyzer but let's check so we don't hang or blow up.
336940
@Override
	protected void sendStatusFromPartitionToAnalyzerIfPresent() {
		if (analyzerStatusQueue != null) {
			logger.fine("Send status from partition for analyzeStatus with batchStatus = " + stepStatus.getBatchStatus() + ", exitStatus = " + stepStatus.getExitStatus());
			PartitionDataWrapper dataWrapper = new PartitionDataWrapper();
			dataWrapper.setBatchStatus(stepStatus.getBatchStatus());
			dataWrapper.setExitStatus(stepStatus.getExitStatus());
			dataWrapper.setEventType(PartitionEventType.ANALYZE_STATUS);
			analyzerStatusQueue.add(dataWrapper);
		} else {
			logger.fine("Analyzer not configured.");
		}
	}
1312739
def check_archive_ext (archive):
    """"""
    if not archive.lower().endswith(".dms"):
        rest = archive[-4:]
        msg = "xdms(1) archive file must end with `.dms', not `%s'" % rest
        raise util.PatoolError(msg)
1344691
private function trashCollect()
    {
        if ($this->cfg['trashCollect']) {
            if (!empty($_SERVER['REDIRECT_STATUS']) && $_SERVER['REDIRECT_STATUS'] == '404') {
                // this is a 404 page... likely casued by a missing asset on the "calling" page
                $this->debug->warn('404 - not trash collecting');
                return;
            }
            $this->persist->trashCollect();
        }
    }
1194719
@Override
    public <R, A> R collect(Collector<? super T, A, R> collector) {
        Predicate<A> finished = finished(collector);
        if (finished != null) {
            BiConsumer<A, ? super T> acc = collector.accumulator();
            BinaryOperator<A> combiner = collector.combiner();
            Spliterator<T> spliterator = spliterator();
            if (!isParallel()) {
                A a = collector.supplier().get();
                if (!finished.test(a)) {
                    try {
                        // forEachRemaining can be much faster
                        // and take much less memory than tryAdvance for certain
                        // spliterators
                        spliterator.forEachRemaining(e -> {
                            acc.accept(a, e);
                            if (finished.test(a))
                                throw new CancelException();
                        });
                    } catch (CancelException ex) {
                        // ignore
                    }
                }
                return collector.finisher().apply(a);
            }
            Spliterator<A> spltr;
            if (!spliterator.hasCharacteristics(Spliterator.ORDERED)
                || collector.characteristics().contains(Characteristics.UNORDERED)) {
                spltr = new UnorderedCancellableSpliterator<>(spliterator, collector.supplier(), acc, combiner,
                        finished);
            } else {
                spltr = new OrderedCancellableSpliterator<>(spliterator, collector.supplier(), acc, combiner, finished);
            }
            return collector.finisher().apply(
                new StreamEx<>(StreamSupport.stream(spltr, true), context).findFirst().get());
        }
        return rawCollect(collector);
    }
104885
private boolean checkEnabled() {
        try {
            return getSettings().getBoolean(Settings.KEYS.ANALYZER_ARTIFACTORY_ENABLED);
        } catch (InvalidSettingException ise) {
            LOGGER.warn("Invalid setting. Disabling the Artifactory analyzer");
        }
        return false;
    }
651654
function collect() {
		$inc_failed = count($this->_failed['inc']);
		$dec_failed = count($this->_failed['dec']);
		$n_saved    = count($this->_saved);
		$n_inc      = count($this->_increased);
		$n_dec      = count($this->_decreased);
		$n_fetched  = count($this->_fetched);
		$n_deleted  = count($this->_deleted);
		$data = array(
			'count'       =>0,
			'messages'    =>array(),
		);
		if ( $inc_failed+$dec_failed>0 ) {
			$data['messages'][] =  array(
				'message'  => "Caches Failed: [ Inc:{$inc_failed} , Dec:{$dec_failed} ]",
				'is_string'=> true,
				'label'    => 'Caches Summary'
			);
		}
		$message = "Caches Count: [ Saved:{$n_saved} ; Gets:{$n_fetched}";
		if ( $this->_nulls>0 ) {
			$message .= "(nulls:{$this->_nulls})";
		}
		if ( $n_inc>0 ) {
			$message .= " ; Inc:{$n_inc}";
		}
		if ( $n_dec>0 ) {
			$message .= " ; Dec:{$n_dec}";
		}
		if ( $n_deleted>0 ) {
			$message .= " ; Deleted:{$n_deleted}";
		}
		if ( $this->_flushed ) {
			$message .= " ; Has Flushed";
		}
		$data['messages'][] = array(
			'message'  => $message.' ]',
			'is_string'=> true,
			'label'    => 'Caches Summary'
		);

		if ( !$this->_mode && $this->_messagesCollector ) {
			foreach ( $data['messages'] as $value ) {
				$this->_messagesCollector->addMessage($value['message'],$value['label'],$value['is_string']);
			}
			return array();
		}

		$messages = array();
		foreach ( $this->_saved as $key=>$value ) {
			$lifetime = '';
			if ( $value['lifetime']!==null ) {
				$lifetime = "Lifetime=>"."{$value['lifetime']}";
			}
			$content    = $value['content'];
			if ( !is_string( $content ) ) {
				$content = $this->formatVars($content);
				$message= "Saved: [ Key=>\"$key\"  $lifetime  Value=> $content[0] ]";
			}else{
				$message= "Saved: [ Key=>\"$key\"  $lifetime  Value=> \"$content\" ]";
			}
			$messages[] = array(
				'message'   => $message,
				'is_string' => mb_strlen($message)>100?false:true,
				'label'     => 'Saved',
				'time'      =>$value['time'],
			);
		}
		foreach ( $this->_fetched as $key=>$value ) {
			$content = $value['value'];
			if ( !is_string( $value ) ) {
				$content = $this->formatVars($content);
				$message= "Gets: [ Key=>\"$key\"   Value=> $content[0] ]";
			}else{
				$message= "Gets: [ Key=>\"$key\"   Value=> \"$content\" ]";
			}
			$messages[] = array(
				'message'   => $message,
				'is_string' => mb_strlen($message)>100?false:true,
				'label'     => 'Gets',
				'time'      => $value['time'],
			);
		}
		foreach ( $this->_deleted as $value ) {
			$messages[] = array(
				'message'   => 'DeletedKey: [ '.$value['key'].' ]',
				'is_string' => true,
				'label'     => 'Deleted',
				'time'      => $value['time'],
			);
		}
		foreach ( $this->_increased as $value ) {
			$messages[] = array(
				'message'   => "Increased: [ Key:{$value['key']} , Step:{$value['step']} , NewValue:{$value['new_value']}] ",
				'is_string' => true,
				'label'     => 'Increased',
				'time'      => $value['time'],
			);
		}
		foreach ( $this->_decreased as $value ) {
			$messages[] = array(
				'message'   => "Decreased: [ Key:{$value['key']} , Step:{$value['step']} , NewValue:{$value['new_value']}] ",
				'is_string' => true,
				'label'     => 'Decreased',
				'time'      => $value['time'],
			);
		}
		foreach ( $this->_failed['inc'] as $value ) {
			$messages[] = array(
				'message'   => "IncFailed: [ Key:{$value['key']} , Step:{$value['step']}] ",
				'is_string' => true,
				'label'     => 'IncFailed',
				'time'      => $value['time'],
			);
		}
		foreach ( $this->_failed['dec'] as $value ) {
			$messages[] = array(
				'message'   => "DecFailed: [ Key:{$value['key']} , Step:{$value['step']}] ",
				'is_string' => true,
				'label'     => 'DecFailed',
				'time'      => $value['time'],
			);
		}
		$data['messages'] = array_merge($data['messages'],  $this->sort($messages));
		$data['count'] = count($messages);
		return $data;
	}
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);
      }
    }
278145
def OnDestroy(self, event):
        """"""
        # deregister observers
        if hasattr(self, 'cardmonitor'):
            self.cardmonitor.deleteObserver(self.cardtreecardobserver)
        if hasattr(self, 'readermonitor'):
            self.readermonitor.deleteObserver(self.readertreereaderobserver)
            self.cardmonitor.deleteObserver(self.readertreecardobserver)
        event.Skip()
978959
def _check_collections(self):
        """"""

        self.collection_sizes = {}
        self.collection_total = 0
        for col in self.db.collection_names(include_system_collections=False):
            self.collection_sizes[col] = self.db.command('collstats', col).get(
                'storageSize', 0)
            self.collection_total += self.collection_sizes[col]

        sorted_x = sorted(self.collection_sizes.items(),
                          key=operator.itemgetter(1))

        for item in sorted_x:
            self.log("Collection size (%s): %.2f MB" % (
                item[0], item[1] / 1024.0 / 1024),
                     lvl=verbose)

        self.log("Total collection sizes: %.2f MB" % (self.collection_total /
                                                      1024.0 / 1024))
1342684
def findUselessCheckers(self, allowedMessages):
        
        uselessCheckers = []
        for checkerName in self.linter._checkers:
            for checker in list(self.linter._checkers[checkerName]):
                messagesOfChecker = set(checker.msgs)
                if not messagesOfChecker.intersection(allowedMessages):
                    uselessCheckers.append(checker)
        return uselessCheckers
74506
public synchronized void cancel() {
        // If the packet collector has already been cancelled, do nothing.
        if (cancelled) {
            return;
        }

        cancelled = true;
        connection.removeStanzaCollector(this);
        notifyAll();

        if (collectorToReset != null) {
            collectorToReset.cancel();
        }
    }
1317217
def maybe_inspect_zip(models):
    
    '''

    if not(is_zip_file(models)):
        return models

    if len(models) > 1:
        return models

    if len(models) < 1:
        raise AssertionError('No models at all')

    return zipfile.ZipFile(models[0]).namelist()
493669
protected void sendCollectorDataToAnalyzerIfPresent(Serializable data) {
		if (analyzerStatusQueue != null) {
			logger.finer("Sending collector partition data: " + data + " to analyzer queue: " + analyzerStatusQueue);
			PartitionDataWrapper dataWrapper = new PartitionDataWrapper();
			dataWrapper.setCollectorData(data);
			dataWrapper.setEventType(PartitionEventType.ANALYZE_COLLECTOR_DATA);
			analyzerStatusQueue.add(dataWrapper);
		} else {
			logger.fine("Analyzer not configured.");
		}
	}
498630
function unwatch (poet) {
  poet.watchers.forEach(function (watcher) {
    watcher.watcher.close();
  });
  poet.futures.forEach(function (future) {
    clearTimeout(future);
  });
  poet.watchers = [];
  poet.futures = [];
  return poet;
}
288775
void accessStaticUnchecked(CodeBuilder mv) {
    checkState(isStatic());
    mv.getStatic(owner().type(), FieldRef.this.name(), type());
  }
401220
public boolean mightContain(T item) {
		BucketAndTag pos = hasher.generate(item);
		long i1 = pos.index;
		long i2 = hasher.altIndex(pos.index, pos.tag);
		bucketLocker.lockBucketsRead(i1, i2);
		try {
			if (table.findTag(i1, i2, pos.tag)) {
				return true;
			}
		} finally {
			bucketLocker.unlockBucketsRead(i1, i2);
		}
		return checkIsVictim(pos);
	}
317905
public void garbageCollect() {
    if (softLimit == 0) {
      reset();
    } else if (data.size() > hardLimit) {
      long boundaryTime = data.get(softLimit).getStartTime();
      data.removeIf((MtasSolrStatus status) -> status.getStartTime() < boundaryTime);
      index.clear();
      data.forEach((MtasSolrStatus status) -> index.put(status.key(), status));
    }
  }