Trainer only command.
Checks the current status of the ball.
975357
public void addCheckBallCommand() {
        StringBuilder buf = new StringBuilder();
        buf.append("(check_ball)");
        fifo.add(fifo.size(), buf.toString());
    }
1212394
def trigger(self):
        
        ibsta = self._lib.ibtrg(self._device)
        self._check_status(ibsta)
127816
def status(name, sig=None):
    '''
    
    '''
    if sig:
        return bool(__salt__['status.pid'](sig))

    cmd = '{0} check {1}'.format(_cmd(), name)
    return not __salt__['cmd.retcode'](cmd)
971561
def status(self):
        ''''''
        self.status_callcount += 1
        self.last_bored = time.time() # status entertains us
        return("status called %(status_callcount)d times.  My target positions=%(packets_mytarget)u  Other target positions=%(packets_mytarget)u" %
               {"status_callcount": self.status_callcount,
                "packets_mytarget": self.packets_mytarget,
                "packets_othertarget": self.packets_othertarget,
               })
1361115
function checkSpawnSuccess(command) {
  // spawn expects a command and a separate array containing each argument
  const parts = command.split(' ');
  return spawnSync(parts[0], parts.slice(1), {stdio: 'inherit'}).status === 0;
}
940700
def _run_check(self, low_data):
        '''
        
        '''
        ret = {'result': False, 'comment': []}
        cmd_opts = {}

        if 'shell' in self.opts['grains']:
            cmd_opts['shell'] = self.opts['grains'].get('shell')

        if 'onlyif' in low_data:
            _ret = self._run_check_onlyif(low_data, cmd_opts)
            ret['result'] = _ret['result']
            ret['comment'].append(_ret['comment'])
            if 'skip_watch' in _ret:
                ret['skip_watch'] = _ret['skip_watch']

        if 'unless' in low_data:
            _ret = self._run_check_unless(low_data, cmd_opts)
            # If either result is True, the returned result should be True
            ret['result'] = _ret['result'] or ret['result']
            ret['comment'].append(_ret['comment'])
            if 'skip_watch' in _ret:
                # If either result is True, the returned result should be True
                ret['skip_watch'] = _ret['skip_watch'] or ret['skip_watch']

        return ret
745533
def status(self):
        
        if 'sandbox_type' in self.engine.data:
            if self.engine.sandbox_type == 'none':
                return False
            return True
        return False
415709
def status(self):
        """"""
        status = self.receiver.status(self)
        return status if status else (
            self.response_code, self.response.get('message')
        )
334242
def in_check_as_result(self, pos, move):
        
        test = cp(pos)
        test.update(move)
        test_king = test.get_king(move.color)

        return self.loc_adjacent_to_opponent_king(test_king.location, test)
242770
def reset_ball(self, x, y):
        """"""
        self.sprite.position.x = x
        self.sprite.position.y = y
1054850
def is_check(self) -> bool:
        """"""
        king = self.king(self.turn)
        return king is not None and self.is_attacked_by(not self.turn, king)
1196881
def run(cmd):
    

    status, output = commands.getstatusoutput(cmd)
    if status:
        print(output)
    return status == 0
1306415
def _run_check_onlyif(self, low_data, cmd_opts):
        '''
        
        '''
        ret = {'result': False}

        if not isinstance(low_data['onlyif'], list):
            low_data_onlyif = [low_data['onlyif']]
        else:
            low_data_onlyif = low_data['onlyif']

        def _check_cmd(cmd):
            if cmd != 0 and ret['result'] is False:
                ret.update({'comment': 'onlyif condition is false',
                            'skip_watch': True,
                            'result': True})
            elif cmd == 0:
                ret.update({'comment': 'onlyif condition is true', 'result': False})

        for entry in low_data_onlyif:
            if isinstance(entry, six.string_types):
                cmd = self.functions['cmd.retcode'](
                    entry, ignore_retcode=True, python_shell=True, **cmd_opts)
                log.debug('Last command return code: %s', cmd)
                _check_cmd(cmd)
            elif isinstance(entry, dict):
                if 'fun' not in entry:
                    ret['comment'] = 'no `fun` argument in onlyif: {0}'.format(entry)
                    log.warning(ret['comment'])
                    return ret
                result = self.functions[entry.pop('fun')](**entry)
                if self.state_con.get('retcode', 0):
                    _check_cmd(self.state_con['retcode'])
                elif not result:
                    ret.update({'comment': 'onlyif condition is false',
                                'skip_watch': True,
                                'result': True})
                else:
                    ret.update({'comment': 'onlyif condition is true',
                                'result': False})

            else:
                ret.update({'comment': 'onlyif execution failed, bad type passed', 'result': False})
        return ret
459294
def get_trainer(self, id_, respect_privacy=True, detail=True):
		""""""
		
		parameters = {}
		if respect_privacy is False:
			parameters['statistics'] = 'force'
		if detail is False:
			parameters['detail'] = 'low'
			
		r = requests.get(api_url+'trainers/'+str(id_)+'/', headers=self.headers) if respect_privacy is True else requests.get(api_url+'trainers/'+str(id_)+'/', params=parameters, headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return Trainer(r.json())
619838
def check_command(self, name, exclude_packages=None, exclude_command_class=None):
    
    return get_command_class(
        name, 
        exclude_packages=exclude_packages,
        exclude_command_class=exclude_command_class) is not None
53507
function(client, packet) {
            var ball_id = packet.readUInt32LE();
            var ball    = client.balls[ball_id] || new Ball(client, ball_id);
            ball.mine   = true;
            if(!client.my_balls.length) client.score = 0;
            client.my_balls.push(ball_id);

            if(client.debug >= 2)
                client.log('my new ball: ' + ball_id);

            if(client.spawn_interval_id) {
                if(client.debug >= 4)
                    client.log('detected new ball, disabling spawn() interval');
                client.spawn_attempt = 0;
                clearInterval(client.spawn_interval_id);
                client.spawn_interval_id = 0;
            }

            client.emitEvent('myNewBall', ball_id);
        }
221086
def check_for_end_game(self):
		
		gameover = False
		for player in self.players:
			if player.playstate in (PlayState.CONCEDED, PlayState.DISCONNECTED):
				player.playstate = PlayState.LOSING
			if player.playstate == PlayState.LOSING:
				gameover = True

		if gameover:
			if self.players[0].playstate == self.players[1].playstate:
				for player in self.players:
					player.playstate = PlayState.TIED
			else:
				for player in self.players:
					if player.playstate == PlayState.LOSING:
						player.playstate = PlayState.LOST
					else:
						player.playstate = PlayState.WON
			self.state = State.COMPLETE
			self.manager.step(self.next_step, Step.FINAL_WRAPUP)
			self.manager.step(self.next_step, Step.FINAL_GAMEOVER)
			self.manager.step(self.next_step)