def prepare(self, params=None ):

        if isinstance( params, tuple ) or isinstance( params, list ):
            try:
                self._user = params[0]
                self._pass = params[1]
                self._client_id = params[2]

            except IndexError:
                # Use default for non existent indexes
                pass

        self._append( ( FIELD_STRINGS, [NAME, VERSION] ) )
        self._append( ( FIELD_SHORT, SUPPORTED_PROTOCOL ) )

        self._append( ( FIELD_STRING, self._client_id ) )

        # Set the serialization type on the shared socket object
        self._orientSocket.serialization_type = self._serialization_type

        if self.get_protocol() > 21:
            self._append( ( FIELD_STRING, self._serialization_type ) )

        if self.get_protocol() > 26:
            self._append( ( FIELD_BOOLEAN, self._request_token ) )

        self._append( ( FIELD_STRING, self._user ) )
        self._append( ( FIELD_STRING, self._pass ) )

        return super( ConnectMessage, self ).prepare()
dataset/ETHPy150Open mogui/pyorient/pyorient/messages/connection.py/ConnectMessage.prepare/original