def __call__(self, element, strict=False):
        found = []
        contexts = [(self.ops, element)]

        for _ops, el in contexts:
            for idx in xrange(len(_ops)):
                op, data = _ops[idx]
                if op is TOP:
                    el = el.root
                elif op is UP:
                    if el.parent:
                        el = el.parent
                elif op is NAME:
                    try:
                        el = el._index(data)
                    except (LookupError, __HOLE__):
                        if strict:
                            if el.name:
                                type_ = '%s element %r' % (
                                    el.__class__.__name__, el.name)
                            else:
                                type_ = 'Unnamed element %s' % (
                                    el.__class__.__name__)
                            raise LookupError(
                                "%s has no child %r in expression %r" % (
                                    type_, data, self.expr))
                        break
                elif op is SLICE:
                    children = list(el.children)[data]
                    contexts.extend((_ops[idx + 1:], child)
                                    for child in children)
                    break
            else:
                found.append(el)
        return found
dataset/ETHPy150Open jek/flatland/flatland/schema/paths.py/PathExpression.__call__