'State during subnegotiation'

def _state_sb(self):

    b = self.__buf
    o = ''
    i = 0
    while (i < len(b)):
        c = b[i]
        n = b[(i + 1)]
        if (c == IAC):
            if (n == IAC):
                i += 2
                o += IAC
                continue
            elif (n == SE):
                self._sb(o)
                self.__buf = self.__buf[(i + 2):]
                self._state = self._state_default
                return
        o += c
        i += 1
    return
