def BuildAdGroupOperations(batch_job_helper, campaign_operations, number_of_adgroups=1):
 adgroup_operations = [{'xsi_type': 'AdGroupOperation', 'operand': {'campaignId': campaign_operation['operand']['id'], 'id': batch_job_helper.GetId(), 'name': ('Batch Ad Group #%s' % uuid.uuid4()), 'biddingStrategyConfiguration': {'bids': [{'xsi_type': 'CpcBid', 'bid': {'microAmount': 10000000}}]}}, 'operator': 'ADD'} for campaign_operation in campaign_operations for _ in range(number_of_adgroups)]
 return adgroup_operations

def BuildAdGroupOperations ( batch_job_helper , campaign_operations , number_of_adgroups = 1 ) : adgroup_operations = [ { 'xsi_type' : 'AdGroupOperation' , 'operand' : { 'campaignId' : campaign_operation [ 'operand' ] [ 'id' ] , 'id' : batch_job_helper . GetId ( ) , 'name' : ( 'Batch Ad Group #%s' % uuid . uuid4 ( ) ) , 'biddingStrategyConfiguration' : { 'bids' : [ { 'xsi_type' : 'CpcBid' , 'bid' : { 'microAmount' : 10000000 } } ] } } , 'operator' : 'ADD' } for campaign_operation in campaign_operations for _ in range ( number_of_adgroups ) ] return adgroup_operations
builds the operations adding desired number of adgroups to given campaigns .