Play a failed flush full of counters back into the system
175253
def replay_counters(buffer)
      buffer.each { |k, v| counter(k[0], v, k[1]) }
    end
534120
private void doFlush() throws SQLException {
		if (batchCount > 0) {
			try {
				statement.executeBatch();
				batchCount = 0;
			} catch (SQLException ex) {
				resetConnection();
				throw ex;
			}
		}
	}
212334
def flush():
    """"""
    try:
        sys.stdout.flush()
        sys.stderr.flush()
    except (AttributeError, ValueError, IOError):
        pass  # unsupported
    try:
        libc.fflush(None)
    except (AttributeError, ValueError, IOError):
        pass
947776
def play_env_problem_randomly(env_problem,
                              num_steps):
  """"""
  # Reset all environments.
  env_problem.reset()

  # Play all environments, sampling random actions each time.
  for _ in range(num_steps):
    # Sample batch_size actions from the action space and stack them.
    actions = np.stack([env_problem.action_space.sample() for _ in range(
        env_problem.batch_size)])

    # Execute actions, observations are stored in `env_problem`.
    _, _, dones, _ = env_problem.step(actions)

    # Get the indices where we are done and reset those.
    env_problem.reset(indices=done_indices(dones))
338562
def abort(self, count=2, timeout=60):
        '''
        
        '''
        for counter in xrange(0, count):
            self.putc(CAN, timeout)
1222466
def flushall(self, async_op=False):
        
        if async_op:
            fut = self.execute(b'FLUSHALL', b'ASYNC')
        else:
            fut = self.execute(b'FLUSHALL')
        return wait_ok(fut)
648882
def scrub
      return unless playing?
      response = connection.get("/scrub").response
      parts = response.body.split("\n")
      Hash[parts.collect { |v| v.split(": ") }]
    end
977826
def pop(queue, quantity=1, is_runner=False):
    '''
    
    '''
    cmd = 'SELECT name FROM {0}'.format(queue)
    if quantity != 'all':
        try:
            quantity = int(quantity)
        except ValueError as exc:
            error_txt = ('Quantity must be an integer or "all".\n'
                         'Error: "{0}".'.format(exc))
            raise SaltInvocationError(error_txt)
        cmd = ''.join([cmd, ' LIMIT {0}'.format(quantity)])
    log.debug('SQL Query: %s', cmd)
    con = _conn(queue)
    items = []
    with con:
        cur = con.cursor()
        result = cur.execute(cmd).fetchall()
        if result:
            items = [item[0] for item in result]
            itemlist = '","'.join(items)
            _quote_escape(itemlist)
            del_cmd = '''DELETE FROM {0} WHERE name IN ("{1}")'''.format(
                queue, itemlist)

            log.debug('SQL Query: %s', del_cmd)

            cur.execute(del_cmd)
        con.commit()
    if is_runner:
        items = [salt.utils.json.loads(item[0].replace("'", '"')) for item in result]
    log.info(items)
    return items
1191445
def reset(self):
        '''
        '''
        for index in range(self.counts_len):
            self.counts[index] = 0
        self.total_count = 0
        self.min_value = sys.maxsize
        self.max_value = 0
        self.start_time_stamp_msec = sys.maxsize
        self.end_time_stamp_msec = 0
446637
def retry_call(func, cleanup=lambda: None, retries=0, trap=()):
	
	attempts = count() if retries == float('inf') else range(retries)
	for attempt in attempts:
		try:
			return func()
		except trap:
			cleanup()

	return func()
815017
def _ensure_counter(self):
        """"""
        if self._counter_path not in self._client.kv:
            self._client.kv[self._counter_path] = ''.zfill(self._COUNTER_FILL)
584208
public void reset() {
        data.rewind();

        // Read off the rows, columns, and non-zero elements
        data.getInt();
        data.getInt();
        data.getInt();

        // Reset the counters.
        curCol = 0;
        entry = 0;
        try {
            advance();
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
    }
1350848
function retry(count) {
    if (count === void 0) {
        count = -1;
    }
    return function (source) { return source.lift(new RetryOperator(count, source)); };
}
1216700
def hard_reset(self):
        """"""
        if self.seq is not None and self.shuffle:
            random.shuffle(self.seq)
        if self.imgrec is not None:
            self.imgrec.reset()
        self.cur = 0
        self._allow_read = True
        self._cache_data = None
        self._cache_label = None
        self._cache_idx = None
1081681
private void checkTileOverFlow() throws MahjongTileOverFlowException {
        //
        for (int i = 0; i < handsComp.length; i++) {
            int hand = handsComp[i];
            if (hand > 4) {
                canWin = false;
                throw new MahjongTileOverFlowException(i, hand);
            }
        }
    }
640443
def flush_all(self, conn):
        """"""
        command = b'flush_all\r\n'
        response = yield from self._execute_simple_command(
            conn, command)

        if const.OK != response:
            raise ClientException('Memcached flush_all failed', response)
336388
def flush(self):
        """"""
        keys = list(self.keys())
        if keys:
            return self.database.delete(*keys)