def add_code(self, client_id, user_id, lifetime):

        expires = add_seconds_to_date(datetime.datetime.now(), lifetime)

        # do -> while FTW
        code = self.generate_hash_sha1()
        while self.get_refresh_token(code):
            code = self.generate_hash_sha1()

        self.db.codes(self.db.codes.code_id == code).update(**{'client_id': client_id,
                                                            'user_id': user_id,
                                                            'expires': expires})

        return code
Add tracking to all trainers.
dataset/ETHPy150Open joaoqalves/web2py-oauth2/modules/oauth/storage/__init__.py/web2pyStorage.add_code--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/cross_validation/train_cv_extensions.py/MonitorBasedSaveBestCV.setup