<s> import json <EOL> from allauth . socialaccount . providers . oauth . client import OAuth <EOL> from allauth . socialaccount . providers . oauth . views import ( OAuthAdapter , <EOL> OAuthLoginView , <EOL> OAuthCallbackView ) <EOL> from . provider import VimeoProvider <EOL> class VimeoAPI ( OAuth ) : <EOL> url = '<STR_LIT>' <EOL> def get_user_info ( self ) : <EOL> url = self . url <EOL> data = json . loads ( self . query ( url , params = dict ( format = '<STR_LIT>' ) ) ) <EOL> return data [ '<STR_LIT>' ] <EOL> class VimeoOAuthAdapter ( OAuthAdapter ) : <EOL> provider_id = VimeoProvider . id <EOL> request_token_url = '<STR_LIT>' <EOL> access_token_url = '<STR_LIT>' <EOL> authorize_url = '<STR_LIT>' <EOL> def complete_login ( self , request , app , token , response ) : <EOL> client = VimeoAPI ( request , app . client_id , app . secret , <EOL> self . request_token_url ) <EOL> extra_data = client . get_user_info ( ) <EOL> return self . get_provider ( ) . sociallogin_from_response ( request , <EOL> extra_data ) <EOL> oauth_login = OAuthLoginView . adapter_view ( VimeoOAuthAdapter ) <EOL> oauth_callback = OAuthCallbackView . adapter_view ( VimeoOAuthAdapter ) </s>
