@classmethod
    def find(cls, db, token):
        prefix = token[:cls.prefix_length]
        # since we can't filter on hashed values, filter on prefix
        # so we aren't comparing with all tokens
        prefix_match = db.query(cls).filter(bindparam('prefix', prefix).startswith(cls.prefix))
        for orm_token in prefix_match:
            if orm_token.match(token):
                return orm_token
Complete country codes ("SE", "DE", ...)
dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/orm.py/APIToken.find--crossover with--dataset/ETHPy150Open SpriteLink/NIPAP/nipap-cli/nipap_cli/nipap_cli.py/complete_country