Make sure the replay isn't corrupt, and is worth looking at.
762431
def valid_replay(info, ping):
  """"""
  if (info.HasField("error") or
      info.base_build != ping.base_build or  # different game version
      info.game_duration_loops < 1000 or
      len(info.player_info) != 2):
    # Probably corrupt, or just not interesting.
    return False
  for p in info.player_info:
    if p.player_apm < 10 or p.player_mmr < 1000:
      # Low APM = player just standing around.
      # Low MMR = corrupt replay or player who is weak.
      return False
  return True
241058
private function CleanUp() {

		// remove possible empty keys
		$AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate');
		foreach ($AVpossibleEmptyKeys as $dummy => $key) {
			if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
				unset($this->info['audio'][$key]);
			}
			if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
				unset($this->info['video'][$key]);
			}
		}

		// remove empty root keys
		if (!empty($this->info)) {
			foreach ($this->info as $key => $value) {
				if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
					unset($this->info[$key]);
				}
			}
		}

		// remove meaningless entries from unknown-format files
		if (empty($this->info['fileformat'])) {
			if (isset($this->info['avdataoffset'])) {
				unset($this->info['avdataoffset']);
			}
			if (isset($this->info['avdataend'])) {
				unset($this->info['avdataend']);
			}
		}

		// remove possible duplicated identical entries
		if (!empty($this->info['error'])) {
			$this->info['error'] = array_values(array_unique($this->info['error']));
		}
		if (!empty($this->info['warning'])) {
			$this->info['warning'] = array_values(array_unique($this->info['warning']));
		}

		// remove "global variable" type keys
		unset($this->info['php_memory_limit']);

		return true;
	}
1127753
function () {
    if (player.playing) player.pause()
    else player.play()
    if (player.playing) {
      clickToPlay.style.display = 'none'
    } else {
      clickToPlay.textContent = 'Paused'
      clickToPlay.style.display = 'block'
    }
  }
545220
def save_and_check(response, local_file, expected_checksum):
    """"""
    with open(local_file, 'wb') as handle:
        for chunk in response.iter_content(4096):
            handle.write(chunk)

    actual_checksum = md5sum(local_file)
    if actual_checksum != expected_checksum:
        logging.error('Checksum mismatch for %r. Expected %r, got %r',
                      local_file, expected_checksum, actual_checksum)
        return False

    return True
580480
private void checkExistingTracks() {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                for (Map.Entry<DeckReference, TrackMetadata> entry : MetadataFinder.getInstance().getLoadedTracks().entrySet()) {
                    if (entry.getKey().hotCue == 0) {  // The track is currently loaded in a main player deck
                        checkIfSignatureReady(entry.getKey().player);
                    }
                }
            }
        });
    }
242762
function () {
  vid2.read(function (err, m2) {
	if (writer2 === null)
	  writer2 = new cv.VideoWriter(filename2, 'DIVX', vid2.getFPS(), m2.size(), true);

	x++;
	writer2.write(m2, function(err){
	  if (x < 100) {
		iter();
	  } else {
		vid2.release();
		writer2.release();
	  }
	});
	m2.release();
	delete m2;
  });
}
567022
def play(self):
        """"""
        if self._proc.state() == QProcess.Running:
            if self.isPlaying is False:
                self._execute("pause")
                self._changePlayingState(True)
        elif self._filePath is not None:
            self._kill()
            self._run(self._filePath)
            self._changePlayingState(True)
14558
def handle_play_pause_clicked(self):
        
        if self.__scan_hardware_source:
            if self.is_playing:
                self.__scan_hardware_source.stop_playing()
            else:
                self.__scan_hardware_source.start_playing()
1341078
function () {
    var data = this.data;
    var recordingdb = this.el.systems.recordingdb;;
    var recordingNames;
    var src;
    var self = this;

    // Allow override to display replayer from query param.
    if (new URLSearchParams(window.location.search).get('avatar-replayer-disabled') !== null) {
      return;
    }

    recordingdb.getRecordingNames().then(function (recordingNames) {
      // See if recording defined in query parameter.
      var queryParamSrc = self.getSrcFromSearchParam();

      // 1. Try `avatar-recorder` query parameter as recording name from IndexedDB.
      if (recordingNames.indexOf(queryParamSrc) !== -1) {
        log('Replaying `' + queryParamSrc + '` from IndexedDB.');
        recordingdb.getRecording(queryParamSrc).then(bind(self.startReplaying, self));
        return;
      }

      // 2. Use `avatar-recorder` query parameter or `data.src` as URL.
      src = queryParamSrc || self.data.src;
      if (src) {
        if (self.data.src) {
          log('Replaying from component `src`', src);
        } else if (queryParamSrc) {
          log('Replaying from query parameter `recording`', src);
        }
        self.loadRecordingFromUrl(src, false, bind(self.startReplaying, self));
        return;
      }

      // 3. Use `data.recordingName` as recording name from IndexedDB.
      if (recordingNames.indexOf(self.data.recordingName) !== -1) {
        log('Replaying `' + self.data.recordingName + '` from IndexedDB.');
        recordingdb.getRecording(self.data.recordingName).then(bind(self.startReplaying, self));
      }
    });
  }
1140427
def _check(self): # TODO: fix?
        """"""
        if self._returncode:
            rarfile.check_returncode(self, '')
        if self._remain != 0:
            raise rarfile.BadRarFile("Failed the read enough data")
1141270
private void doExportToWave()
	{
		doStopPlaying();
		
		if (currentContainer==null)
	    {
	    	JOptionPane.showMessageDialog(this, "You need to load a file first!", "Ups!", JOptionPane.ERROR_MESSAGE);
	    }
	    else
	    {
	    	do
		    {
				String fileName = Helpers.createLocalFileStringFromURL(currentContainer.getFileURL(), true);
				fileName = fileName.substring(fileName.lastIndexOf(File.separatorChar)+1);
				String exportToWav = exportPath + File.separatorChar + fileName + ".WAV";
				FileChooserResult selectedFile = Helpers.selectFileNameFor(this, exportToWav, "Export to wave", fileFilterExport, 1, false, false);
				if (selectedFile!=null)
				{
					File f = selectedFile.getSelectedFile();
				    if (f!=null)
				    {
				    	if (f.exists())
				    	{
				    		int result = JOptionPane.showConfirmDialog(this, "File already exists! Overwrite?", "Overwrite confirmation", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
				    		if (result==JOptionPane.CANCEL_OPTION) return;
				    		if (result==JOptionPane.NO_OPTION) continue; // Reselect
				    		boolean ok = f.delete();
				    		if (!ok)
				    		{
		        		    	JOptionPane.showMessageDialog(MainForm.this, "Overwrite failed. Is file write protected or in use?", "Failed", JOptionPane.ERROR_MESSAGE);
		        		    	return;
				    		}
				    	}
				    	// get Export Type from selected filechooser index (find the index ;) )
				    	String modFileName = f.getAbsolutePath();
				    	int i = modFileName.lastIndexOf(File.separatorChar);
				    	exportPath = modFileName.substring(0, i);
			    		int result = JOptionPane.showConfirmDialog(this, "Continue playback while exporting?", "Playback?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

			    		Mixer mixer = createNewMixer();
				    	mixer.setPlayDuringExport(result==JOptionPane.YES_OPTION);
				    	mixer.setExportFile(f);
				    	playerThread = new PlayThread(mixer, this);
				    	playerThread.start();
			    		
				    	inExportMode = true; // Signal, that we are exporting right now...
				    }
				}
		    	return;
		    }
		    while (true);
	    }
	}
399943
private void checkStability() {
    if ((_watermarksInserted.getCount() - _watermarksSwept.getCount()) > _watermarkLagThreshold) {
      log.error("Setting abort flag for Watermark tracking because the lag between the "
          + "watermarksInserted: {} and watermarksSwept: {} is greater than the threshold: {}",
          _watermarksInserted.getCount(), _watermarksSwept.getCount(), _watermarkLagThreshold);
      _abort.set(true);
    }
  }
1213788
def _check(self):
        

        if self.timestamp < 0.0:
            raise ValueError("the timestamp may not be negative")
        if isinf(self.timestamp):
            raise ValueError("the timestamp may not be infinite")
        if isnan(self.timestamp):
            raise ValueError("the timestamp may not be NaN")

        if self.is_remote_frame and self.is_error_frame:
            raise ValueError("a message cannot be a remote and an error frame at the sane time")

        if self.arbitration_id < 0:
            raise ValueError("arbitration IDs may not be negative")

        if self.is_extended_id:
            if 0x20000000 <= self.arbitration_id:
                raise ValueError("Extended arbitration IDs must be less than 2^29")
        elif 0x800 <= self.arbitration_id:
            raise ValueError("Normal arbitration IDs must be less than 2^11")

        if self.dlc < 0:
            raise ValueError("DLC may not be negative")
        if self.is_fd:
            if 64 < self.dlc:
                raise ValueError("DLC was {} but it should be <= 64 for CAN FD frames".format(self.dlc))
        elif 8 < self.dlc:
            raise ValueError("DLC was {} but it should be <= 8 for normal CAN frames".format(self.dlc))

        if self.is_remote_frame:
            if self.data is not None and len(self.data) != 0:
                raise ValueError("remote frames may not carry any data")
        elif self.dlc != len(self.data):
            raise ValueError("the DLC and the length of the data must match up for non remote frames")

        if not self.is_fd:
            if self.bitrate_switch:
                raise ValueError("bitrate switch is only allowed for CAN FD frames")
            if self.error_state_indicator:
                raise ValueError("error state indicator is only allowed for CAN FD frames")
966103
async def playing(self):
        """"""
        # TODO: This is hack-ish
        if self._setstate is None:
            await self.protocol.start()

        # No SET_STATE_MESSAGE received yet, use default
        if self._setstate is None:
            return MrpPlaying(protobuf.SetStateMessage(), None)

        return MrpPlaying(self._setstate, self._nowplaying)
1053376
def _check(self):
        """"""
        final = self._md_context.digest()
        exp = self._inf._md_expect
        if exp is None:
            return
        if final is None:
            return
        if self._returncode:
            check_returncode(self, '')
        if self._remain != 0:
            raise BadRarFile("Failed the read enough data")
        if final != exp:
            raise BadRarFile("Corrupt file - CRC check failed: %s - exp=%r got=%r" % (
                self._inf.filename, exp, final))
184366
def replay(journal_entry, function, *args, **kwargs):
    '''
    
    '''
    # Starts the fiber section
    section = fiber.WovenSection()
    section.enter()

    # Check if this is the first recording in the fiber section
    journal_mode = section.state.get(RECMODE_TAG, None)
    is_first = journal_mode is None

    if is_first:
        section.state[RECMODE_TAG] = JournalMode.replay
        section.state[JOURNAL_ENTRY_TAG] = IJournalReplayEntry(journal_entry)

    result = function(*args, **kwargs)

    # We don't want anything asynchronous to be called,
    # so we abort the fiber section
    section.abort(result)
    # side effects are returned in sake of making sure that
    # all the side effects expected have been consumed (called)
    return result
433226
def _sanity_check(self):
        
        windows = self.lag_window_size + self.future_window_size
        if (not self.lag_window_size or not self.future_window_size or self.time_series_length < windows or windows < DEFAULT_BITMAP_MINIMAL_POINTS_IN_WINDOWS):
            raise exceptions.NotEnoughDataPoints

        # If window size is too big, too many data points will be assigned a score of 0 in the first lag window
        # and the last future window.
        if self.lag_window_size > DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS:
            self.lag_window_size = DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS
        if self.future_window_size > DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS:
            self.future_window_size = DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS