<s> """<STR_LIT>""" <EOL> from googleads import dfp <EOL> KEY_ID = '<STR_LIT>' <EOL> def main ( client , key_id ) : <EOL> custom_targeting_service = client . GetService ( <EOL> '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> filter_values = [ { <EOL> '<STR_LIT:key>' : '<STR_LIT>' , <EOL> '<STR_LIT:value>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:value>' : key_id <EOL> } <EOL> } ] <EOL> query = '<STR_LIT>' <EOL> statement = dfp . FilterStatement ( query , filter_values ) <EOL> deleted_custom_targeting_values = <NUM_LIT:0> <EOL> while True : <EOL> response = custom_targeting_service . getCustomTargetingValuesByStatement ( <EOL> statement . ToStatement ( ) ) <EOL> if '<STR_LIT>' in response : <EOL> value_ids = [ value [ '<STR_LIT:id>' ] for value in response [ '<STR_LIT>' ] ] <EOL> action = { '<STR_LIT>' : '<STR_LIT>' } <EOL> value_query = ( '<STR_LIT>' <EOL> '<STR_LIT>' % '<STR_LIT:U+002CU+0020>' . join ( value_ids ) ) <EOL> value_statement = dfp . FilterStatement ( value_query , filter_values ) <EOL> result = custom_targeting_service . performCustomTargetingValueAction ( <EOL> action , value_statement . ToStatement ( ) ) <EOL> if result and int ( result [ '<STR_LIT>' ] ) > <NUM_LIT:0> : <EOL> deleted_custom_targeting_values += int ( result [ '<STR_LIT>' ] ) <EOL> statement . offset += dfp . SUGGESTED_PAGE_LIMIT <EOL> else : <EOL> break <EOL> if deleted_custom_targeting_values > <NUM_LIT:0> : <EOL> print ( '<STR_LIT>' <EOL> % deleted_custom_targeting_values ) <EOL> else : <EOL> print '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> dfp_client = dfp . DfpClient . LoadFromStorage ( ) <EOL> main ( dfp_client , KEY_ID ) </s>
