def popitem(self, desc=False, score=1, remove=0):
        resultset = []
        def block(trial, transaction):
            pipe = self.session.client
            zrange = pipe.zrevrange if desc else pipe.zrange
            self.session.mark_query()
            resultset[:] = zrange(self.key, 0, 0, withscores=True)
            if resultset:
                self.session.mark_manipulative()
                if remove is None or resultset[0][1] - score <= remove:
                    pipe.zrem(self.key, resultset[0][0])
                else:
                    pipe.zincrby(self.key,
                                 value=resultset[0][0],
                                 amount=-score)
            else:
                raise KeyError('pop from an empty set')
        self.session.transaction(block, [self.key], ignore_double=True)
        value, score = resultset[0]
        return self.value_type.decode(value), score
Given an HMM model and a sequence of observations, computes the Baum-Welch 
dataset/ETHPy150Open dahlia/sider/sider/sortedset.py/SortedSet.popitem--crossover with--dataset/ETHPy150Open QuantSoftware/QuantSoftwareToolkit/QSTK/qstklearn/hmm.py/baumwelchstep