Check state in playing case.
180589
private void checkStatePlaying()
    {
        if (!reverse)
        {
            if (repeat)
            {
                state = AnimState.PLAYING;
                current = first;
            }
            else
            {
                state = AnimState.FINISHED;
            }
        }
        else
        {
            state = AnimState.REVERSING;
        }
    }
1185686
def verify_state(self):
        """"""
        if self.state == CONNECTING:
            self.state = OPEN

            self.conn.on_open(self.conn_info)
676257
def check(
    state,
    unused=False,
    style=False,
    ignore=None,
    args=None,
    **kwargs
):
    """"""
    from ..core import do_check

    do_check(
        three=state.three,
        python=state.python,
        system=state.system,
        unused=unused,
        ignore=ignore,
        args=args,
        pypi_mirror=state.pypi_mirror,
    )
521637
def getStatus(self):
    """"""
    command = '$GS'
    status = self.sendCommand(command)
    return states[int(status[1])]
836016
def update_check(self, existing, new):
        
        old_state = existing.state
        if 'NowPlayingItem' in existing.session_raw:
            try:
                old_theme = existing.session_raw['NowPlayingItem']['IsThemeMedia']
            except KeyError:
                old_theme = False
        else:
            old_theme = False

        if 'NowPlayingItem' in new:
            if new['PlayState']['IsPaused']:
                new_state = STATE_PAUSED
            else:
                new_state = STATE_PLAYING

            try:
                new_theme = new['NowPlayingItem']['IsThemeMedia']
            except KeyError:
                new_theme = False

        else:
            new_state = STATE_IDLE
            new_theme = False

        if old_theme or new_theme:
            return False
        elif old_state == STATE_PLAYING or new_state == STATE_PLAYING:
            return True
        elif old_state != new_state:
            return True
        else:
            return False
752653
def check_if_win(self):
        """"""
        self.flagcount = 0
        win = True
        for x in range(0, len(self.mine_matrix[0])):
            for y in range(0, len(self.mine_matrix)):
                if self.mine_matrix[y][x].state == 1:
                    self.flagcount += 1
                    if not self.mine_matrix[y][x].has_mine:
                        win = False
                elif self.mine_matrix[y][x].has_mine:
                    win = False
        self.lblMineCount.set_text("%s" % self.minecount)
        self.lblFlagCount.set_text("%s" % self.flagcount)
        if win:
            self.dialog = gui.GenericDialog(title='You Win!', message='Game done in %s seconds' % self.time_count)
            self.dialog.confirm_dialog.do(self.new_game)
            self.dialog.cancel_dialog.do(self.new_game)
            self.dialog.show(self)
113669
public synchronized void checkState(State... requiredStates) throws IllegalStateException {
        for (State requiredState : requiredStates) {
            if (requiredState.equals(currentState)) {
                return;
            }
        }
        throw new IllegalStateException(String.format(Locale.US,
                "Expected states %s, but in state %s", Lists.newArrayList(requiredStates), currentState));
    }
809519
def state(self, state):
        """"""
        with self._lock:
            self._value = self._states.index(state)
922630
public Set<PlaybackState> getPlaybackState() {
        Set<PlaybackState> result = new HashSet<PlaybackState>(playbackStateMap.values());
        return Collections.unmodifiableSet(result);
    }
685556
public synchronized void checkState(State requiredState) throws IllegalStateException {
        if (requiredState != currentState) {
            throw new IllegalStateException(String.format(Locale.US,
                    "Expected state %s, but in state %s", requiredState, currentState));
        }
    }
1012842
def play(self):
        """"""
        self._response['shouldEndSession'] = True
        self._response['action']['audio']['interface'] = 'play'
        self._response['action']['audio']['sources'] = []
        return self
427731
function (status) {
                if  (anouncementIds.length > 0 && anouncementIds.indexOf(that.getCurrentPlaylistId()) < 0)
                {
                  //The item after the announcement has starting buffering -> restore original volume if required
                  if (urlOptions && urlOptions.volume) {
                    that._client.setVolumePromise(currentVolume);
                    urlOptions = undefined; //So we not set it again on every status update
                  }

                  if (that.getStatus().playerState != "BUFFERING") {
                    //The item after the announcement has starting playing -> remove announcement from list
                    log.info ("%s - Resumed after announcement", that._name);
                    that.removeFromPlaylistPromise(anouncementIds);
                    anouncementIds = [];
                    //Anouncement ended
                    return resolve(url);
                  }

                }

                if
                (
                  anouncementIds.length === 0 /*Already completed announcement*/ &&
                  (
                    //Did we insert a chunk?
                    chunkItemIds.length === 0 ||
                    //Next item started playing ?
                    (nextItem && that.getCurrentPlaylistId() == nextItem.itemId && that.getStatus().playerState != "BUFFERING")
                  )
                )
                {
                  //The remaining current item we just inserted has starting playing -> remove
                  log.info ("%s - Back to regular playlist", that._name);
                  if (chunkItemIds.length > 0)
                    that.removeFromPlaylistPromise(chunkItemIds);

                  //We are done
                  that.removeListener(that.EVENT_STATUS, resumeAfterAnnouncement);
                  return;
                }

                //Sanity check - if all items disapear then this means that a new playlist was loaded
                let idsToCheck=anouncementIds.concat(chunkItemIds);
                let allGone = true;

                for (let i in idsToCheck) {
                  if (that._playlist.getItemWithId(idsToCheck[i]) != undefined)
                    allGone = false;
                    break;
                }
                if (allGone) {
                  log.warn("%s - remaining item to play after announcement not found in the playlist -> remove status handled", that._name);
                  that.removeListener(that.EVENT_STATUS, resumeAfterAnnouncement);
                  log.debug("%s - Player status:\n%s",that._name, util.inspect(that._status,{depth:null, colors:true}))
                }

                //Not the status update we are waiting for
              }
696518
protected function checkAge()
    {
        $this->_is_old = false;

        switch ($this->_browser_name) {
            case 'Opera':
                if ($this->_version < 10)
                    $this->_is_old = true;
                break;
            case 'Firefox':
            case 'Iceweasel':
                if ($this->_version < 3)
                    $this->_is_old = true;
                break;
            case 'Safari':
                if ($this->_version < 5)
                    $this->_is_old = true;
                break;
            case 'Chrome':
                if (version_compare($this->_version, 5, '<'))
                    $this->_is_old = true;
                break;
            case 'iPhone':
            case 'iPod':
                $this->_is_old = true;
                break;
        }
    }
517609
def state(self):
    """"""
    ev = self._query_waiters.request(self.__do_query_state)
    ev.wait(1.0)
    return self._state
418733
function canPlayTypeToNumber(playability) {
	if (playability === 'probably') {
		return 2;
	} else if (playability === 'maybe') {
		return 1;
	} else if (playability === '') {
		return 0;
	} else if (typeof playability === 'string') {
		throw new Error('Expected a string "probably", "maybe" or "" but received ' + playability + '.');
	}

	throw new TypeError(String(playability) + ' is not a string. Expected a string "probably", "maybe" or "".');
}
426214
def state(self):
        
        # Check if device is disconnected.
        if not self.available:
            return STATE_UNKNOWN
        # Check if device is off.
        if not self.screen_on:
            return STATE_OFF
        # Check if screen saver is on.
        if not self.awake:
            return STATE_IDLE
        # Check if the launcher is active.
        if self.launcher or self.settings:
            return STATE_STANDBY
        # Check for a wake lock (device is playing).
        if self.wake_lock:
            return STATE_PLAYING
        # Otherwise, device is paused.
        return STATE_PAUSED
1332774
def current_state_str(self):
        """"""
        if self.sample_ok:
            msg = ''
            temperature = self._get_value_opc_attr('temperature')
            if temperature is not None:
                msg += 'Temp: %s ºC, ' % temperature
            humidity = self._get_value_opc_attr('humidity')
            if humidity is not None:
                msg += 'Humid: %s %%, ' % humidity
            pressure = self._get_value_opc_attr('pressure')
            if pressure is not None:
                msg += 'Press: %s mb, ' % pressure
            light_level = self._get_value_opc_attr('light_level')
            if light_level is not None:
                msg += 'Light: %s lux, ' % light_level
            return msg[:-2]
        else:
            return "Bad sample"