def _auth(url, user, passwd, realm):
    '''
    returns a authentication handler.
    '''

    basic = _HTTPBasicAuthHandler()
    basic.add_password(realm=realm, uri=url, user=user, passwd=passwd)
    digest = _HTTPDigestAuthHandler()
    digest.add_password(realm=realm, uri=url, user=user, passwd=passwd)
    return _build_opener(basic, digest)
def _auth ( url , user , passwd , realm ) : basic = _HTTPBasicAuthHandler ( ) basic . add_password ( realm = realm , uri = url , user = user , passwd = passwd ) digest = _HTTPDigestAuthHandler ( ) digest . add_password ( realm = realm , uri = url , user = user , passwd = passwd ) return _build_opener ( basic , digest )
returns a authentication handler.