def GetPlatformRestrictions(campaign_feed):
  platform_restrictions = None

  if campaign_feed['matchingFunction']['operator'] == 'AND':
    for argument in campaign_feed['matchingFunction']['lhsOperand']:
      # Check if matchingFunction is EQUALS(CONTEXT.DEVICE, 'Mobile')
      if argument['value']['operator'] == 'EQUALS':
        request_context_operand = argument['value']['lhsOperand'][0]

        if (request_context_operand and
            request_context_operand == 'DEVICE_PLATFORM'):
                  # This needs to be capitalized for ExtensionSettingPlatform.
          platform_restrictions = argument['value']['rhsOperand'][0].upper()

  return platform_restrictions
Checks whether the passed condition is on top of the queue.
dataset/ETHPy150Open googleads/googleads-python-lib/examples/adwords/v201603/migration/migrate_to_extension_settings.py/GetPlatformRestrictions--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/locking.py/SharedLock.__is_on_top