def _to_edges(self, tokens):
        # prepend self.order Nones
        chain = self._end_context + tokens + self._end_context

        has_space = False

        context = []

        for i in xrange(len(chain)):
            context.append(chain[i])

            if len(context) == self.order:
                if chain[i] == self.SPACE_TOKEN_ID:
                    context.pop()
                    has_space = True
                    continue

                yield tuple(context), has_space

                context.pop(0)
                has_space = False
Adds a child widget, generating and returning a key if not provided
dataset/ETHPy150Open pteichman/cobe/cobe/brain.py/Brain._to_edges--crossover with--dataset/ETHPy150Open dddomodossola/remi/remi/gui.py/Widget.append