def GetPlatformRestrictions(campaign_feed):
 platform_restrictions = None
 if (campaign_feed['matchingFunction']['operator'] == 'AND'):
  for argument in campaign_feed['matchingFunction']['lhsOperand']:
   if (argument['value']['operator'] == 'EQUALS'):
    request_context_operand = argument['value']['lhsOperand'][0]
    if (request_context_operand and (request_context_operand == 'DEVICE_PLATFORM')):
     platform_restrictions = argument['value']['rhsOperand'][0].upper()
 return platform_restrictions

def GetPlatformRestrictions ( campaign_feed ) : platform_restrictions = None if ( campaign_feed [ 'matchingFunction' ] [ 'operator' ] == 'AND' ) : for argument in campaign_feed [ 'matchingFunction' ] [ 'lhsOperand' ] : if ( argument [ 'value' ] [ 'operator' ] == 'EQUALS' ) : request_context_operand = argument [ 'value' ] [ 'lhsOperand' ] [ 0 ] if ( request_context_operand and ( request_context_operand == 'DEVICE_PLATFORM' ) ) : platform_restrictions = argument [ 'value' ] [ 'rhsOperand' ] [ 0 ] . upper ( ) return platform_restrictions
get the platform restrictions for a given campaign feed .