def _decode_header(self):

        # read header's information
        self._header = [ self._decode_field( FIELD_BYTE ),
                         self._decode_field( FIELD_INT ) ]

        from .connection import ConnectMessage
        from .database import DbOpenMessage
        """
        #  Token authentication handling
        #  we must recognize ConnectMessage and DbOpenMessage messages
            TODO: change this check avoiding cross import,
            importing a subclass in a super class is bad
        """
        if not isinstance( self, ( ConnectMessage, DbOpenMessage ) ) \
                and self._request_token is True:
            token_refresh = self._decode_field( FIELD_STRING )
            if token_refresh != b'':
                self._auth_token = token_refresh
                self._update_socket_token()

        # decode message errors and raise an exception
        if self._header[0] == 1:

            # Parse the error
            exception_class = b''
            exception_message = b''

            more = self._decode_field( FIELD_BOOLEAN )

            while more:
                # read num bytes by the field definition
                exception_class += self._decode_field( FIELD_STRING )
                exception_message += self._decode_field( FIELD_STRING )
                more = self._decode_field( FIELD_BOOLEAN )

            if 18 > self.get_protocol():  # > 18 1.6-snapshot
                # read serialized version of exception thrown on server side
                # useful only for java clients
                serialized_exception = self._decode_field( FIELD_STRING )
                # trash
                del serialized_exception

            raise PyOrientCommandException(
                exception_class.decode( 'utf8' ),
                [ exception_message.decode( 'utf8' ) ]
            )

        elif self._header[0] == 3:
            # Push notification, Node cluster changed
            # TODO: UNTESTED CODE!!!
            # FIELD_BYTE (OChannelBinaryProtocol.PUSH_DATA);  # WRITE 3
            # FIELD_INT (Integer.MIN_VALUE);  # SESSION ID = 2^-31
            # 80: \x50 Request Push 1 byte: Push command id
            push_command_id = self._decode_field(FIELD_BYTE)
            push_message = self._decode_field( FIELD_STRING )
            _, payload = self.get_serializer().decode(push_message)
            if self._push_callback:
                self._push_callback(push_command_id, payload)

            # self._cluster_map.set_hi_availability_list(
            #    self._decode_field( FIELD_STRING )
            # )  # JSON WITH THE NEW CLUSTER CFG

            end_flag = self._decode_field( FIELD_BYTE )

            # this flag can be set more than once
            while end_flag == 3:
                self._decode_field( FIELD_INT )  # FAKE SESSION ID = 2^-31
                self._decode_field( FIELD_BYTE )  # 80: 0x50 Request Push
                self._cluster_map.set_hi_availability_list(
                    self._decode_field( FIELD_STRING )
                )  # JSON WITH THE NEW CLUSTER CFG

                """
                :type: self._cluster_map pyorient.messages.cluster.Information
                """
                end_flag = self._decode_field( FIELD_BYTE )

            # Try to set the new session id???
            self._header[1] = self._decode_field( FIELD_INT )  # REAL SESSION ID
            pass
dataset/ETHPy150Open mogui/pyorient/pyorient/messages/base.py/BaseMessage._decode_header/swapped operands of `>`