def initiate_upgrade_connection(self, settings_header=None):
        frame_data = None

        if self.client_side:
            f = SettingsFrame(0)
            for setting, value in self.local_settings.items():
                f.settings[setting] = value

            frame_data = f.serialize()
            frame_data = base64.urlsafe_b64encode(frame_data)

        # Set up appropriate state. Stream 1 in a half-closed state:
        # half-closed(local) for clients, half-closed(remote) for servers.
        # Additionally, we need to set up the Connection state machine.
        self.initiate_connection()

        connection_input = (
            ConnectionInputs.SEND_HEADERS if self.client_side
            else ConnectionInputs.RECV_HEADERS
        )
        self.state_machine.process_input(connection_input)

        # Set up stream 1.
        self._begin_new_stream(stream_id=1, allowed_ids=AllowedStreamIDs.ODD)
        self.streams[1].upgrade(self.client_side)
        return frame_data
Call to initialise the connection object for use with an upgraded
dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py/H2Connection.initiate_upgrade_connection