Returns a list of all triggers
associated with the given key.

\param string $token
Some key associated with a series
of triggers.

\retval array
A list of all triggers associated
with the given key.
325386
public function getTriggers($token)
    {
        $fmt = $this->getFormatter(false);

        if (!is_string($token) || strpos($token, ' ') === false) {
            throw new \Erebot\InvalidValueException($fmt->_('Invalid token'));
        }

        list($chan, $pos) = explode(' ', $token);

        if (!isset($this->triggers[$chan][$pos])) {
            throw new \Erebot\NotFoundException($fmt->_('No such triggers'));
        }

        return $this->triggers[$chan][$pos];
    }
1317061
def get_triggers(self):
        
        status, data = self.http_client.get_json(
            TRIGGERS_URI,
            params={'appid': self.API_key},
            headers={'Content-Type': 'application/json'})
        return [self.trigger_parser.parse_dict(item) for item in data]
33798
protected function getTokenFormatter($token)
    {
        $formatters = $this->getTokenFormatters();

        if (!array_key_exists($token, $formatters)) {
            $message = "The class %s does not know how to format the %s token\n".
                       "Have you added it in the getTokenFormatters() method?";

            throw new Exception(sprintf($message, get_called_class(), $token));
        }

        return $formatters[$token];
    }
909259
public function invalidate(Token $token)
    {
        if (! $this->blacklistEnabled) {
            throw new JWTException('You must have the blacklist enabled to invalidate a token.');
        }

        return $this->blacklist->add($this->decode($token));
    }
783319
public function delete($token)
    {
        $query = $this->find(compact('token'));

        return $query->count() ? $this->getTable()->delete($query->first()) : false;
    }
1360686
protected function parseToken($token)
    {
        [$id, $content] = $token;

        if ($id == T_INLINE_HTML) {
            foreach ($this->compilers as $type) {
                $content = $this->{"compile{$type}"}($content);
            }
        }

        return $content;
    }
632421
protected static function token(&$token, &$context) {
        $context['currentToken'] = &$token;

        if (static::rawblock($token, $context)) {
            return Token::toString($token);
        }

        if (static::delimiter($token, $context)) {
            return;
        }

        if (static::isDelimiter($context)) {
            static::spacing($token, $context);
            return;
        }

        if (static::comment($token, $context)) {
            static::spacing($token, $context);
            return;
        }

        list($raw, $vars) = Parser::parse($token, $context);

        // Handle spacing (standalone tags, partial indent)
        static::spacing($token, $context, (($token[Token::POS_OP] === '') || ($token[Token::POS_OP] === '&')) && (!$context['flags']['else'] || !isset($vars[0][0]) || ($vars[0][0] !== 'else')) || ($context['flags']['nostd'] > 0));

        $partials = static::partialBlock($context, $vars);
        $partials = static::inlinePartial($context, $vars) || $partials;

        if ($partials) {
            $context['stack'] = array_slice($context['stack'], 0, -4);
            $context['currentToken'][Token::POS_LOTHER] = '';
            $context['currentToken'][Token::POS_LSPACE] = '';
            return;
        }

        if (static::operator($token[Token::POS_OP], $context, $vars)) {
            return isset($token[Token::POS_BACKFILL]) ? null : array($raw, $vars);
        }

        if (count($vars) == 0) {
            return $context['error'][] = 'Wrong variable naming in ' . Token::toString($token);
        }

        if (!isset($vars[0])) {
            return $context['error'][] = 'Do not support name=value in ' . Token::toString($token) . ', you should use it after a custom helper.';
        }

        $context['usedFeature'][$raw ? 'raw' : 'enc']++;

        foreach ($vars as $var) {
            if (!isset($var[0]) || ($var[0] === 0)) {
                if ($context['level'] == 0) {
                    $context['usedFeature']['rootthis']++;
                }
                $context['usedFeature']['this']++;
            }
        }

        if (!isset($vars[0][0])) {
            return array($raw, $vars);
        }

        if (($vars[0][0] === 'else') && $context['flags']['else']) {
            static::doElse($context, $vars);
            return array($raw, $vars);
        }

        if (!static::helper($context, $vars)) {
            static::lookup($context, $vars);
            static::log($context, $vars);
        }

        return array($raw, $vars);
    }
509303
public function deleteToken($token)
    {
        return $this->queryBuilder->from($this->getTokenTable())
            ->where('token', $token)
            ->delete();
    }
432495
public static function findByActivationToken($token)
    {
        if (!static::isActivationTokenValid($token)) {
            return null;
        }
        return static::find()->where(['activation_token' => $token, 'status' => self::STATUS_REGISTERED])->limit(1)->one();
    }
194686
public static function check( $token )
    {
        $token_name = 'token';

        if(Session::exists($token_name) && $token == Session::exists($token_name) )
        {
            Session::delete($token_name);
            return true;
        }
        return false;
    }
780021
public function getEmailByToken($token)
    {
        $reminder = $this->getReminder()
            ->where('token', '=', $token)
            ->where('created_at', '>=', $this->getOldestValidDate())
            ->first();

        return $reminder->email;
    }
1123612
protected function getItemName($token)
    {
        $name = $this->prefixKey($token);

        if ($this->isItemNameValid($name)) {
            return $name;
        }

        return false;
    }
710639
public function checkObfuscatePart(Token $token)
    {
        $tokenValue = $token->getValue();
        return substr($tokenValue, 0, $this->config['hash']['session.index']) == $this->obfuscate($this->deobfuscate($tokenValue), $token->getDate());
    }
1198479
private function _checkProhibitedTokens($token) {
		if ($this->_isActive('checkProhibitedTokens')) {
			if (in_array($token->getName(), $this->_prohibitedTokens)) {
				$msg = $this->_getMessage("PROHIBITED_TOKEN", $token->getName());
				$this->_writeError('checkProhibitedTokens', $msg);
			}
		}
	}
791283
public function fetchToken(string $token) : ?Token
    {
        return $this->getModel()
                    ->newQuery()
                    ->where('token', $token)
                    ->first();
    }
701444
protected static function _splitConditions($token)
    {
        $conditions = false;
        $position = strpos($token, '[');
        if ($position !== false) {
            $conditions = substr($token, $position);
            $token = substr($token, 0, $position);
        }

        return [$token, $conditions];
    }
589983
protected function getTokenData(Token $token)
    {
        return [
            'id' => $token->getId(),
            'expires' => $token->getExpiresAt()->format(\DateTime::ISO8601),
        ];
    }