Is this game regicide.
332531
def is_regicide(self):
        """"""
        for i in range(1, self._header.replay.num_players):
            for obj in self._header.initial.players[i].objects:
                if obj.type == 'unit' and obj.object_type == 'king':
                    return True
        return False
1030947
function getPlayerTopKills(playerId, opts, cb) {
  // https://gameinfo.albiononline.com/api/gameinfo/players/Nubya8P6QWGhI6hDLQHIQQ
  opts = opts || {};
  query = "?";
  if(opts.limit) {
    query += `limit=${opts.limit}`;
  }
  if(opts.offset) {
    query += `offset=${opts.offset}`;
  }
  if(opts.range) { // week, lastWeek, month, lastMonth
    query += `range=${opts.range}`;
  }
  baseRequest(`/players/${playerId}/topkills${query}`, cb);
}
1354903
function stopAllActivePlayers(connection) {
	return connection.Player.GetActivePlayers().then(function(players) {
		/* Stop everything thats playing */
		return Promise.all(players.map(function(player) {
			return connection.Player.Stop(player.playerid);
		}));
	});
}
372891
void unregisterUse() {
		final int value = this.uses.decrementAndGet();
		if (value == 0) {
			uninstall(UninstallationStage.PRE_DESTROY_EVENT);
			uninstall(UninstallationStage.POST_DESTROY_EVENT);
		}
	}
557583
def is_move_legal(self, move):
        ''
        if move is None:
            return True
        if self.board[move] != EMPTY:
            return False
        if move == self.ko:
            return False
        if self.is_move_suicidal(move):
            return False

        return True
243553
protected function destroyPreviousFights()
    {
        // Delete previous fight for this championship
        $arrGroupsId = $this->championship->fightersGroups()->get()->pluck('id');
        if (count($arrGroupsId) > 0) {
            Fight::destroy($arrGroupsId);
        }
    }
39031
function isMyTurn(game, from) {
    if (game.score.ended)
        return false;
    from = Board.getPositionFromBoard(game.board, from);
    return isWhiteTurn(game) ? Position.hasWhitePiece(from) : Position.hasBlackPiece(from);
}
127462
def parseOneGame(self):
		
		if self.index < self.datalen:
			match = self.reGameTreeStart.match(self.data, self.index)
			if match:
				self.index = match.end()
				return self.parseGameTree()
		return None
512342
function() {
        if (!this.playing) {
            return;
        }
        
        if (this.callbacks && this.callbacks.done) {
            this.callbacks.done.call(this, this.finish);
        }
        OpenLayers.Animation.stop(this.animationId);
        this.animationId = null;
        this.playing = false;
    }
249702
public void kill() {
    boolean killNow = false;
    synchronized(jobInitKillStatus) {
      jobInitKillStatus.killed = true;
      //if not in middle of init, terminate it now
      if(!jobInitKillStatus.initStarted || jobInitKillStatus.initDone) {
        //avoiding nested locking by setting flag
        killNow = true;
      }
    }
    if(killNow) {
      terminate(JobStatus.KILLED);
    }
  }
840553
def terminate(self, force=False):
        ''' '''

        if not self.isalive():
            return True
        try:
            self.kill(signal.SIGHUP)
            time.sleep(self.delayafterterminate)
            if not self.isalive():
                return True
            self.kill(signal.SIGCONT)
            time.sleep(self.delayafterterminate)
            if not self.isalive():
                return True
            self.kill(signal.SIGINT)
            time.sleep(self.delayafterterminate)
            if not self.isalive():
                return True
            if force:
                self.kill(signal.SIGKILL)
                time.sleep(self.delayafterterminate)
                if not self.isalive():
                    return True
                else:
                    return False
            return False
        except OSError:
            # I think there are kernel timing issues that sometimes cause
            # this to happen. I think isalive() reports True, but the
            # process is dead to the kernel.
            # Make one last attempt to see if the kernel is up to date.
            time.sleep(self.delayafterterminate)
            if not self.isalive():
                return True
            else:
                return False
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)
410463
public function hasPlayed() : bool
    {
        if ($this->comparing() && isset($this->trophyInfo()->comparedUser)) {
            return $this->trophyInfo()->comparedUser;
        } else if (isset($this->trophyInfo()->fromUser)) {
            return $this->trophyInfo()->fromUser;
        }

        return false;
    }
69514
public function ingameCoop()
    {
        foreach ($this->owner->players as $player) {
            if ($player->isCooping) {
                return true;
            }
        }
        return false;
    }
580967
def do_quit(self, arg):
        """"""
        if self.saved:
            self.save()
        else:
            self.parser.clean()
        return True
342713
private boolean isDone()
   {
      switch (status) {
      case Status.STATUS_PREPARING:
      case Status.STATUS_PREPARED:
      case Status.STATUS_COMMITTING:
      case Status.STATUS_COMMITTED:
      case Status.STATUS_ROLLING_BACK:
      case Status.STATUS_ROLLEDBACK:
         return true;
      default:
         return false;
      }
   }
72508
def terminate(self, force=False):
        """"""
        if not self.isalive():
            return True
        self.kill(signal.SIGINT)
        time.sleep(self.delayafterterminate)
        if not self.isalive():
            return True
        if force:
            self.kill(signal.SIGKILL)
            time.sleep(self.delayafterterminate)
            if not self.isalive():
                return True
            else:
                return False