def valid_code(self, client_id, code):
        
        data = self.db.codes.find_one({'_id': code,
                                       'client_id': client_id})
        if data:
            return datetime.datetime.now() < data['expires']

        return False
Validates a URL against this trust root.
dataset/ETHPy150Open joaoqalves/web2py-oauth2/modules/oauth/storage/__init__.py/MongoStorage.valid_code--crossover with--dataset/ETHPy150Open openid/python-openid/openid/server/trustroot.py/TrustRoot.validateURL