<s> from . import transport , client <EOL> def build_headers ( authorization_headers , user_agent ) : <EOL> headers = transport . KeepAliveHeaders ( authorization_headers ) <EOL> if user_agent is not None : <EOL> headers = transport . UserAgentHeaders ( headers , user_agent ) <EOL> return headers <EOL> def OAuthClient ( api_key , api_secret , login , password , user_agent = None , <EOL> domain = "<STR_LIT>" ) : <EOL> auth = transport . OAuthAuthorization ( login , password , <EOL> api_key , api_secret , domain ) <EOL> return AuthorizingClient ( domain , auth , user_agent = user_agent ) <EOL> def OAuthAppClient ( client_id , client_secret , app_id , app_token , user_agent = None , <EOL> domain = "<STR_LIT>" ) : <EOL> auth = transport . OAuthAppAuthorization ( app_id , app_token , <EOL> client_id , client_secret , domain ) <EOL> return AuthorizingClient ( domain , auth , user_agent = user_agent ) <EOL> def AuthorizingClient ( domain , auth , user_agent = None ) : <EOL> """<STR_LIT>""" <EOL> http_transport = transport . HttpTransport ( domain , build_headers ( auth , user_agent ) ) <EOL> return client . Client ( http_transport ) </s>
