@staticmethod
    def translate_to_python(c, top_class=None, text_query=True):
        try:
            i = c.index('(')
        except __HOLE__:
            if text_query:
                return TextQuery(c)
            raise ValueError("Invalid QueryCondition syntax")
        clsname = c[:i]
        cls = find_subclass(top_class or QueryCondition, clsname)
        if cls is not None:
            return cls(*eval(c[i+1:-1]))
        elif text_query:
            return TextQuery(c)
        else:
            raise ValueError("No such condition type: %s" % clsname)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/persistent_archive/queries.py/QueryCondition.translate_to_python