def METHOD_NAME(self, stream):
    S = self.mpy_stacksize
    E = self.mpy_excstacksize
    F = self.co_flags & 0xf
    A = self.co_argcount
    K = self.co_kwonlyargcount
    D = self.mpy_def_pos_args
    S -= 1
    z = (S & 0xf) << 3 | (E & 1) << 2 | (A & 3)
    S >>= 4
    E >>= 1
    A >>= 2
    while S | E | F | A | K | D:
        stream.writebin("B", z | 0x80)
        z = (F & 1) << 6 | (S & 3) << 4 | (K & 1) << 3 \
            | (A & 1) << 2 | (E & 1) << 1 | (D & 1);
        S >>= 2
        E >>= 1
        F >>= 1
        A >>= 1
        K >>= 1
        D >>= 1
    stream.writebin("B", z)