def _check_mandatory_parameters(self, request):
        # The server SHOULD return a 400 (Bad Request) status code when
        # receiving a request with missing parameters.
        if not all((request.signature, request.client_key,
                    request.nonce, request.timestamp,
                    request.signature_method)):
            raise errors.InvalidRequestError(
                description='Missing mandatory OAuth parameters.')

        # OAuth does not mandate a particular signature method, as each
        # implementation can have its own unique requirements.  Servers are
        # free to implement and document their own custom methods.
        # Recommending any particular method is beyond the scope of this
        # specification.  Implementers should review the Security
        # Considerations section (`Section 4`_) before deciding on which
        # method to support.
        # .. _`Section 4`: http://tools.ietf.org/html/rfc5849#section-4
        if (not request.signature_method in
                self.request_validator.allowed_signature_methods):
            raise errors.InvalidSignatureMethodError(
                description="Invalid signature, %s not in %r." % (
                    request.signature_method,
                    self.request_validator.allowed_signature_methods))

        # Servers receiving an authenticated request MUST validate it by:
        #   If the "oauth_version" parameter is present, ensuring its value is
        #   "1.0".
        if (request.oauth_params in 'oauth_version' and
                request.oauth_params['oauth_version'] != '1.0'):
            raise errors.InvalidRequestError(
                description='Invalid OAuth version.')

        # The timestamp value MUST be a positive integer. Unless otherwise
        # specified by the server's documentation, the timestamp is expressed
        # in the number of seconds since January 1, 1970 00:00:00 GMT.
        if len(request.timestamp) != 10:
            raise errors.InvalidRequestError(
                description='Invalid timestamp size')

        try:
            ts = int(request.timestamp)

        except ValueError:
            raise errors.InvalidRequestError(
                description='Timestamp must be an integer.')

        else:
            # To avoid the need to retain an infinite number of nonce values for
            # future checks, servers MAY choose to restrict the time period after
            # which a request with an old timestamp is rejected.
            if abs(time.time() - ts) > self.request_validator.timestamp_lifetime:
                raise errors.InvalidRequestError(
                    description=('Timestamp given is invalid, differ from '
                                 'allowed by over %s seconds.' % (
                                     self.request_validator.timestamp_lifetime)))

        # Provider specific validation of parameters, used to enforce
        # restrictions such as character set and length.
        if not self.request_validator.check_client_key(request.client_key):
            raise errors.InvalidRequestError(
                description='Invalid client key format.')

        if not self.request_validator.check_nonce(request.nonce):
            raise errors.InvalidRequestError(
                description='Invalid nonce format.')
dataset/ETHPy150Open idan/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.py/BaseEndpoint._check_mandatory_parameters/swapped operands of `in`