def GetAdWordsClient(**kwargs):
 client_customer_id = kwargs.get('ccid', 'client customer id')
 dev_token = kwargs.get('dev_token', 'dev_token')
 user_agent = kwargs.get('user_agent', 'user_agent')
 validate_only = kwargs.get('validate_only', False)
 partial_failure = kwargs.get('partial_failure', False)
 report_downloader_headers = kwargs.get('report_downloader_headers', {})
 if ('oauth2_client' in kwargs):
  oauth2_client = kwargs['oauth2_client']
 else:
  oauth_header = {'Authorization': 'header'}
  oauth2_client = mock.Mock()
  oauth2_client.CreateHttpHeader.return_value = dict(oauth_header)
 client = googleads.adwords.AdWordsClient(dev_token, oauth2_client, user_agent, client_customer_id=client_customer_id, cache=kwargs.get('cache'), proxy_config=kwargs.get('proxy_config'), validate_only=validate_only, partial_failure=partial_failure, report_downloader_headers=report_downloader_headers)
 return client

def GetAdWordsClient ( ** kwargs ) : client_customer_id = kwargs . get ( 'ccid' , 'client customer id' ) dev_token = kwargs . get ( 'dev_token' , 'dev_token' ) user_agent = kwargs . get ( 'user_agent' , 'user_agent' ) validate_only = kwargs . get ( 'validate_only' , False ) partial_failure = kwargs . get ( 'partial_failure' , False ) report_downloader_headers = kwargs . get ( 'report_downloader_headers' , { } ) if ( 'oauth2_client' in kwargs ) : oauth2_client = kwargs [ 'oauth2_client' ] else : oauth_header = { 'Authorization' : 'header' } oauth2_client = mock . Mock ( ) oauth2_client . CreateHttpHeader . return_value = dict ( oauth_header ) client = googleads . adwords . AdWordsClient ( dev_token , oauth2_client , user_agent , client_customer_id = client_customer_id , cache = kwargs . get ( 'cache' ) , proxy_config = kwargs . get ( 'proxy_config' ) , validate_only = validate_only , partial_failure = partial_failure , report_downloader_headers = report_downloader_headers ) return client
returns an initialized adwordsclient for use in testing .