def __init__(self, suite, headers, body, method, user, path, query_params, files):
        self.suite = suite
        self.headers = headers
        self.body = body
        self.request_method = method.upper()
        self.user = user
        self.query_params = query_params or {}
        self.files = files
        self.objects = []
        self.api_arguments = {}
        self.formatter_kwargs = {}
        self.query = None

        self.reference = Reference(
            self.suite,
            "{0}?{1}".format(
                 path,
                 urlencode(query_params) if not isinstance(query_params, str) else query_params
            )
        )

        self._parse_query()

        if {'collection','document','subdocument'} in self.reference.kind and self.reference.get_collection().private:
            raise PermissionError("The collection referenced in this request is marked private. It can only be used locally.")

        self.decision_tree = {
            'help': {
                'application': {
                    'GET': self.help,
                    'POST': self.help,
                },
                'application_method': {
                    'GET': self.help,
                    'POST': self.help,
                },
                'collection': {
                    'GET': self.help,
                    'POST': self.help,
                },
                'collection_method': {
                    'GET': self.help,
                    'POST': self.help,
                },
                'document': {
                    'GET': self.help,
                    'POST': self.help,
                },
                'document_method': {
                    'GET': self.help,
                    'POST': self.help,
                },
                'subdocument': {},
            },
            'json': {
                'application': {},
                'application_method': {
                    'GET': partial(self.json_response, self.method_call),
                    'POST': partial(self.json_response, self.method_call),
                },
                'collection': {
                    'GET': partial(self.json_response, self.get_collection_items),
                    'POST': partial(self.json_response, self.add_collection_items),
                    'PUT': partial(self.json_response, self.replace_collection_items),
                    'PATCH': partial(self.json_response, self.update_collection_items),
                    'DELETE': partial(self.json_response, self.delete_collection_items),
                },
                'collection_method': {
                    'GET': partial(self.json_response, self.method_call),
                    'POST': partial(self.json_response, self.method_call),
                },
                'document': {
                    'GET': partial(self.json_response, self.get_document),
                    'POST': partial(self.json_response, self.set_document),
                    'PUT': partial(self.json_response, self.set_document),
                    'PATCH': partial(self.json_response, self.update_document),
                    'DELETE': partial(self.json_response, self.delete_document),
                },
                'document_method': {
                    'GET': partial(self.json_response, self.method_call),
                    'POST': partial(self.json_response, self.method_call),
                },
                'subdocument': {}
            },
            'geojson': {
                'application': {},
                'collection': {
                    'GET': partial(self.geojson_response, self.get_collection_items),
                    },
                'document': {
                    'GET': partial(self.geojson_response, self.get_document),
                    },

            },
            'schema': {
                'application': {
                    'GET': partial(self.json_response, self.schema),
                    'POST': partial(self.json_response, self.schema),
                },
                'application_method': {
                    'GET': partial(self.json_response, self.schema),
                    'POST': partial(self.json_response, self.schema),
                },
                'collection': {
                    'GET': partial(self.json_response, self.schema),
                    'POST': partial(self.json_response, self.schema),
                },
                'collection_method': {
                    'GET': partial(self.json_response, self.schema),
                    'POST': partial(self.json_response, self.schema),
                },
                'document': {
                    'GET': partial(self.json_response, self.schema),
                    'POST': partial(self.json_response, self.schema),
                },
                'document_method': {
                    'GET': partial(self.json_response, self.schema),
                    'POST': partial(self.json_response, self.schema),
                }
            },
        }
dataset/ETHPy150Open JeffHeard/sondra/sondra/api.py/APIRequest.__init__/swapped operands of `in`