<s> from openid . extensions import sreg <EOL> from openid . yadis import xri <EOL> import datetime <EOL> hex_to_int = lambda s : int ( s , <NUM_LIT:16> ) <EOL> int_to_hex = lambda i : hex ( i ) . replace ( '<STR_LIT>' , '<STR_LIT>' ) . lower ( ) . replace ( '<STR_LIT:l>' , '<STR_LIT>' ) <EOL> class OpenID : <EOL> def __init__ ( self , openid , issued , sreg = None ) : <EOL> self . openid = openid <EOL> self . issued = issued <EOL> self . sreg = sreg or { } <EOL> def is_iname ( self ) : <EOL> return xri . identifierScheme ( self . openid ) == '<STR_LIT>' <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % self . openid <EOL> def __unicode__ ( self ) : <EOL> return self . openid <EOL> @ classmethod <EOL> def from_openid_response ( cls , openid_response ) : <EOL> return cls ( <EOL> openid = openid_response . identity_url , <EOL> issued = datetime . datetime . now ( ) , <EOL> sreg = sreg . SRegResponse . fromSuccessResponse ( openid_response ) , <EOL> ) <EOL> """<STR_LIT>""" <EOL> from django . conf . urls import patterns <EOL> from django . core import urlresolvers <EOL> class Router ( object ) : <EOL> def __init__ ( self , * urlpairs ) : <EOL> self . urlpatterns = patterns ( '<STR_LIT>' , * urlpairs ) <EOL> self . resolver = urlresolvers . RegexURLResolver ( r'<STR_LIT>' , None ) <EOL> self . resolver . _urlconf_module = self <EOL> def handle ( self , request , path_override = None ) : <EOL> if path_override is not None : <EOL> path = path_override <EOL> else : <EOL> path = request . path_info <EOL> path = '<STR_LIT:/>' + path <EOL> callback , callback_args , callback_kwargs = self . resolver . resolve ( path ) <EOL> return callback ( request , * callback_args , ** callback_kwargs ) <EOL> def __call__ ( self , request , path_override = None ) : <EOL> return self . handle ( request , path_override ) </s>
