<s> """<STR_LIT>""" <EOL> from social . backends . oauth import BaseOAuth2 <EOL> class StackoverflowOAuth2 ( BaseOAuth2 ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> ID_KEY = '<STR_LIT>' <EOL> AUTHORIZATION_URL = '<STR_LIT>' <EOL> ACCESS_TOKEN_URL = '<STR_LIT>' <EOL> ACCESS_TOKEN_METHOD = '<STR_LIT:POST>' <EOL> SCOPE_SEPARATOR = '<STR_LIT:U+002C>' <EOL> EXTRA_DATA = [ <EOL> ( '<STR_LIT:id>' , '<STR_LIT:id>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ] <EOL> def get_user_details ( self , response ) : <EOL> """<STR_LIT>""" <EOL> fullname , first_name , last_name = self . get_user_names ( <EOL> response . get ( '<STR_LIT>' ) <EOL> ) <EOL> return { '<STR_LIT:username>' : response . get ( '<STR_LIT>' ) . rsplit ( '<STR_LIT:/>' , <NUM_LIT:1> ) [ - <NUM_LIT:1> ] , <EOL> '<STR_LIT>' : fullname , <EOL> '<STR_LIT>' : first_name , <EOL> '<STR_LIT>' : last_name } <EOL> def user_data ( self , access_token , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return self . get_json ( <EOL> '<STR_LIT>' , <EOL> params = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : access_token , <EOL> '<STR_LIT:key>' : self . setting ( '<STR_LIT>' ) <EOL> } <EOL> ) [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> def request_access_token ( self , * args , ** kwargs ) : <EOL> return self . get_querystring ( * args , ** kwargs ) </s>
