def _resolve_refs(self, rule_map, expr, done):
        if isinstance(expr, LazyReference):
            label = unicode(expr)
            try:
                reffed_expr = rule_map[label]
            except KeyError:
                raise UndefinedLabel(expr)
            return self._resolve_refs(rule_map, reffed_expr, done)
        else:
            if getattr(expr, 'members', ()) and expr not in done:
                # Prevents infinite recursion for circular refs. At worst, one
                # of `expr.members` can refer back to `expr`, but it can't go
                # any farther.
                done.add(expr)
                expr.members = [self._resolve_refs(rule_map, member, done)
                                for member in expr.members]
            return expr
Return an expression with all its lazy references recursively
dataset/ETHPy150Open erikrose/parsimonious/parsimonious/grammar.py/RuleVisitor._resolve_refs