This function checks token's pos is with in POS set that user specified.
    If token meets all conditions, Return True; else return False
16119
def __is_valid_pos(pos_tuple, valid_pos):
    # type: (Tuple[text_type,...],List[Tuple[text_type,...]])->bool
    
    def is_valid_pos(valid_pos_tuple):
        # type: (Tuple[text_type,...])->bool
        length_valid_pos_tuple = len(valid_pos_tuple)
        if valid_pos_tuple == pos_tuple[:length_valid_pos_tuple]:
            return True
        else:
            return False

    seq_bool_flags = [is_valid_pos(valid_pos_tuple) for valid_pos_tuple in valid_pos]

    if True in set(seq_bool_flags):
        return True
    else:
        return False
1079199
function verify(token, sign, options) {
  return function (done) {
    _jsonwebtoken2['default'].verifySync(token, sign, options, done);
  };
}
765300
public static function checkToken()
    {
        $token = Input::postString('CML_TOKEN');
        if (empty($token)) return false;
        if ($token !== self::getToken()) return false;
        unset($_COOKIE['CML_TOKEN']);
        return true;
    }
577662
function verifyToken(token) {
    var decodedToken = jwt.decode(token)
    return userdb.users.filter(user => user.name == decodedToken).length > 0;
}
603189
def _getPOS( self, token, onlyFirst = True ):
        ''' 
        '''
        if onlyFirst:
            return token[ANALYSIS][0][POSTAG]
        else:
            return [ a[POSTAG] for a in token[ANALYSIS] ]
504108
protected function checkTokenCondition(\GemS_Tracker_Token $token, $round, $userId)
    {        
        $skipCode = $this->util->getReceptionCodeLibrary()->getSkipString();

        // Only if we have a condition, the token is not yet completed and 
        // receptioncode is ok or skip we evaluate the condition
        if (empty($round['gro_condition']) ||
            $token->isCompleted() ||
            !($token->getReceptionCode()->isSuccess() || $token->getReceptionCode()->getCode() == $skipCode)) {
        
            return 0;            
        }

        $changed   = 0;
        $condition = $this->loader->getConditions()->loadCondition($round['gro_condition']);
        $newStatus = $condition->isRoundValid($token);
        $oldStatus = $token->getReceptionCode()->isSuccess();

        if ($newStatus !== $oldStatus) {
            $changed = 1;
            if ($newStatus == false) {
                $message = $this->_('Skipped by condition %s: %s');
                $newCode = $skipCode;
            } else {
                $message = $this->_('Activated by condition %s: %s');
                $newCode = $this->util->getReceptionCodeLibrary()->getOKString();
            }            

            $token->setReceptionCode($newCode,
                    sprintf($message, $condition->getName(), $condition->getRoundDisplay($token->getTrackId(), $token->getRoundId())),
                    $userId);

            if ($newStatus == true) {
                // Token was made valid, now calc the dates
                $this->checkTokenDates($token, $round, $userId);
            }
        }

        return $changed;
    }
666591
private boolean isTokenMeaningful(String token) {
        token = token.trim();
        return andWords.contains(token) || orWords.contains(token) || token.length() >= 3;
    }
1251190
function checkPlaceholder(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (tokens[start].placeholder_l) return tokens[start].placeholder_l;

  // Skip `%`.
  if (tokens[i].type === TokenType.PercentSign) i++;
  else return 0;

  if (l = checkIdentOrInterpolation(i)) {
    i += l;
    tokens[start].placeholder_l = i - start;
  } else return 0;

  return i - start;
}
540912
def authenticated(self, user_token, **validation_context):
        
        token = self.token_storage.get(user_token)
        if token and token.validate(user_token, **validation_context):
            return True

        return False
1281626
private boolean hasNextValue(boolean update_pos) {
    final int size = iterators.length;
    for (int i = pos + 1; i < size; i++) {
      if (timestamps[i] != 0) {
        //LOG.debug("hasNextValue -> true #" + i);
        if (update_pos) {
          pos = i;
        }
        return true;
      }
    }
    //LOG.debug("hasNextValue -> false (ran out)");
    return false;
  }
213897
private static boolean check(
            final double pXA, final double pYA, final double pXB, final double pYB,
            final double pXC, final double pYC, final double pXD, final double pYD,
            final PointL pIntersection,
            final double pXI, final double pYI
    ) {
        if (pXI < Math.min(pXA, pXB) || pXI > Math.max(pXA, pXB)) {
            return false;
        }
        if (pXI < Math.min(pXC, pXD) || pXI > Math.max(pXC, pXD)) {
            return false;
        }
        if (pYI < Math.min(pYA, pYB) || pYI > Math.max(pYA, pYB)) {
            return false;
        }
        if (pYI < Math.min(pYC, pYD) || pYI > Math.max(pYC, pYD)) {
            return false;
        }
        if (pIntersection != null) {
            pIntersection.x = Math.round(pXI);
            pIntersection.y = Math.round(pYI);
        }
        return true;
    }
525262
@VisibleForTesting
  boolean contains(TokenRange range, Token token, boolean isStart) {
    if (range.isEmpty()) {
      return false;
    }
    if (range.getEnd().equals(minToken)) {
      if (range.getStart().equals(minToken)) { // ]min, min] = full ring, contains everything
        return true;
      } else if (token.equals(minToken)) {
        return !isStart;
      } else {
        return isStart
            ? token.compareTo(range.getStart()) >= 0
            : token.compareTo(range.getStart()) > 0;
      }
    } else {
      boolean isAfterStart =
          isStart ? token.compareTo(range.getStart()) >= 0 : token.compareTo(range.getStart()) > 0;
      boolean isBeforeEnd =
          isStart ? token.compareTo(range.getEnd()) < 0 : token.compareTo(range.getEnd()) <= 0;
      return range.isWrappedAround()
          ? isAfterStart || isBeforeEnd //  ####]----]####
          : isAfterStart && isBeforeEnd; // ----]####]----
    }
  }
1198749
def check_input(self, token):
        
        if not isinstance(token.payload, Evaluation):
            raise Exception(self.full_name + ": Input token is not an Evaluation object!")
166449
def peekuntil(self, token, size=0):
        
        self.__append()

        i = self.buf.find(token, self.pos)
        if i < 0:
            index = max(len(token) - 1, size)
            newpos = max(len(self.buf) - index, self.pos)
            return False, self.buf[self.pos:newpos]

        newpos = i + len(token)
        return True, self.buf[self.pos:newpos]
238946
private static boolean expect(StringTokenizer tokenizer, String token) {
        if (!tokenizer.hasMoreTokens()) {
            return false;
        }
        String s = tokenizer.nextToken();
        if (DEBUG) {
            System.out.println("token=" + s);
        }
        return s.equals(token);
    }
934437
def _add_pos1(token):
    
    result = token.copy()
    result['pos1'] = _POSMAP[token['pos'].split("(")[0]]
    return result
314574
def check_token(self, token=None):
        
        if token is None:
            token = self.token
        resp, resp_body = self.method_head("tokens/%s" % token, admin=True)
        if resp.status_code in (401, 403):
            raise exc.AuthorizationFailure("You must be an admin to make this "
                    "call.")
        return 200 <= resp.status_code < 300