def _call(url, paypal_data, ip=None):
    headers = {}
    auth = settings.PAYPAL_EMBEDDED_AUTH
    if paypal_data not in 'requestEnvelope.errorLanguage':
        paypal_data['requestEnvelope.errorLanguage'] = 'en_US'

    # We always need these headers.
    for key, value in [
            ('application-id', settings.PAYPAL_APP_ID),
            ('request-data-format', 'NV'),
            ('response-data-format', 'NV'),
            ('application-id', settings.PAYPAL_APP_ID),
            ('security-userid', auth['USER']),
            ('security-password', auth['PASSWORD']),
            ('security-signature', auth['SIGNATURE'])]:
        headers['X-PAYPAL-%s' % key.upper()] = value

    if ip:
        headers['X-PAYPAL-DEVICE-IPADDRESS'] = ip

    # Warning, a urlencode will not work with chained payments, it must
    # be sorted and the key should not be escaped.
    try:
        data = _nvp_dump(paypal_data)
        feeddata = requests.post(url, headers=headers, timeout=10,
                                 data=data,
                                 verify=True,
                                 cert=settings.PAYPAL_CERT)
    except AuthError, error:
        paypal_log.error('Authentication error: %s' % error)
        raise
    except Exception, error:
        paypal_log.error('HTTP Error: %s' % error)
        # We'll log the actual error and then raise a Paypal error.
        # That way all the calling methods only have catch a Paypal error,
        # the fact that there may be say, a http error, is internal to this
        # method.
        raise PaypalError

    response = dict(urlparse.parse_qsl(feeddata.text))

    if 'error(0).errorId' in response:
        id_, msg = response['error(0).errorId'], response['error(0).message']
        paypal_log.error('Paypal Error (%s): %s' % (id_, msg))
        raise errors.get(id_, PaypalError)(id=id_, paypal_data=paypal_data)

    return response
dataset/ETHPy150Open mozilla/addons-server/src/olympia/paypal/__init__.py/_call/swapped operands of `not in`