

def verify(self, *args, **kwargs):
    if ('code' in kwargs):
        code = kwargs['code']
        try:
            entry = self.codes[code]
        except KeyError:
            return self.FAILED_AUTHN
        username = entry['username']
        now = time.time()
        if ((now - entry['time']) > self.code_ttl):
            return self.FAILED_AUTHN
        del self.codes[code]
        return (username, True)
    else:
        result = self.first_factor.verify(*args, **kwargs)
        if (result == self.FAILED_AUTHN):
            return self.FAILED_AUTHN
        (username, _) = result
        try:
            receiver = self.user_db[username]['email']
        except KeyError:
            self.FAILED_AUTHN
        code = hashlib.md5(str(time.time())).hexdigest()
        self.codes[code] = {
            'username': response,
            'time': time.time(),
        }
        self._send_mail(code, receiver)
        template = self.template_env.get_template(self.template)
        response = Response(template.render(mail=receiver, action=self.url_endpoint, state=json.dumps(kwargs['state'])))
        return (response, False)

dataset/ETHPy150Open ga4gh/server/oidc-provider/simple_op/src/provider/authn/two_factor.py MailTwoFactor.verify/VarMisuse@214/255 `username`->`response`