def create_wsgi_request(event_info, server_name='zappa', script_name=None,
                        trailing_slash=True):
        """
        Given some event_info,
        create and return a valid WSGI request environ.
        """

        method = event_info['method']
        params = event_info['params']
        query = event_info['query']
        headers = event_info['headers']

        # Make header names canonical, e.g. content-type => Content-Type
        for header in headers.keys():
            canonical = header.title()
            if canonical != header:
                headers[canonical] = headers.pop(header)

        content_type = headers.get('Content-Type', '')
        # Some clients implement a non-rfc compliant content-type string:
        # e.g. "application/json; charset=utf-8"
        content_type = content_type.lower().split(';')[0]
        if content_type == 'application/json':
            body = str(json.dumps(event_info['body']))
        else:
            body = str(event_info['body'])

        path = "/"
        for key in sorted(params.keys()):
            path = path + params[key] + "/"

        # This determines if we should return
        # site.com/resource/ : site.com/resource
        # site.com/resource : site.com/resource
        # vs.
        # site.com/resource/ : site.com/resource/
        # site.com/resource : site.com/resource/
        # If no params are present, keep the slash.
        if not trailing_slash and params.keys():
            path = path[:-1]

        query_string = urlencode(query)

        x_forwarded_for = headers.get('X-Forwarded-For', '')
        if ',' in x_forwarded_for:
            remote_addr = x_forwarded_for.split(', ')[0]
        else:
            remote_addr = '127.0.0.1'

        environ = {
            'PATH_INFO': path,
            'QUERY_STRING': query_string,
            'REMOTE_ADDR': remote_addr,
            'REQUEST_METHOD': method,
            'SCRIPT_NAME': str(''),
            'SERVER_NAME': str(server_name),
            'SERVER_PORT': str('80'),
            'SERVER_PROTOCOL': str('HTTP/1.1'),
            'wsgi.version': (1, 0),
            'wsgi.url_scheme': str('http'),
            'wsgi.input': body,
            'wsgi.errors': str(''),
            'wsgi.multiprocess': False,
            'wsgi.multithread': False,
            'wsgi.run_once': False,
        }

        # Input processing
        if method in ["POST", "PUT", "PATCH"]:
            if 'Content-Type' in event_info["headers"]:
                environ['CONTENT_TYPE'] = event_info["headers"]['Content-Type']

                # Multipart forms are Base64 encoded through API Gateway
                if event_info["headers"]['Content-Type'] in 'multipart/form-data;':
                    body = base64.b64decode(body)

            environ['wsgi.input'] = StringIO(body)

            environ['CONTENT_LENGTH'] = str(len(body))

        for header in event_info["headers"]:
            wsgi_name = "HTTP_" + header.upper().replace('-', '_')
            environ[wsgi_name] = str(event_info["headers"][header])

        if script_name:
            environ['SCRIPT_NAME'] = script_name
            path_info = environ['PATH_INFO']
            if script_name in path_info:
                environ['PATH_INFO'].replace(script_name, '')

        return environ
dataset/ETHPy150Open Miserlou/Zappa/zappa/wsgi.py/create_wsgi_request/swapped operands of `in`