Did I find the right examples for you? yes no

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

        def authenticate(username, password):
    if username == 'aliyun' and password == 'a':
        return User(name = 'aliyun')
    else:
        return None
        


src/a/l/Aliyun-0.1.1/src/aliyun/shell.py   Aliyun(Download)
# -*- coding: utf-8 -
import readline
from authentication import authenticate
from exceptions import CommandNotFound
from sys import exit
                retry += 1
                password = getpass('Password: ')
                self.user = authenticate(username = username, password = password)
 
                if self.user is not None:

src/e/u/Euphorie-6.3.1/src/euphorie/client/api/users.py   Euphorie(Download)
from z3c.saconfig import Session
from five import grok
from AccessControl.SecurityManagement import newSecurityManager
from euphorie.ghost import PathGhost
from ..authentication import authenticate
                    'message': 'Required data missing'}
 
        account = authenticate(login, password)
        if account is None:
            self.request.response.setStatus(403)