This needs to be L = contextg.v_Us_B()

def koenig(self):
        """
        This needs to be L = contextg.v_Us_B()
        """
        L = self
        Y = L - (L*L)
        while True:
            Ybar = Y + ~Y
            take = L - Ybar
            if not len(take):
                return Y
            else:
                ZZ = list(set(take)-set(Y))#use significant which is not in Y
                if len(ZZ) > 0:
                    v = ZZ[0]
                    z=(v,take[v][0])
                else:
                    z = next(take.flatten())
                Yzgen = Y**z
                Y = (Y - Yzgen) + z