def main(client, line_item_id):
  # Initialize appropriate service.
  lica_service = client.GetService(
      'LineItemCreativeAssociationService', version='v201508')

# Create statement object to only select LICAs for the given line item id.
  values = [{
      'key': 'lineItemId',
      'value': {
          'xsi_type': 'NumberValue',
          'value': line_item_id
      }
  }]
  query = 'WHERE lineItemId = :lineItemId'
  statement = dfp.FilterStatement(query, values)

  while True:
    # Get LICAs by statement.
    response = lica_service.getLineItemCreativeAssociationsByStatement(
        statement.ToStatement())

    if 'results' in response:
      # Display results.
      for lica in response['results']:
        print ('LICA with line item id \'%s\', creative id \'%s\', and status '
               '\'%s\' was found.' % (lica['lineItemId'], lica['creativeId'],
                                      lica['status']))
      statement.offset += dfp.SUGGESTED_PAGE_LIMIT
    else:
      break

    print response['totalResultSetSize'] % '\nNumber of results found: %s'
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201508/line_item_creative_association_service/get_licas_by_statement.py/main/swapped operands of `%`