def METHOD_NAME(self, cat="all"):
    # if cat=="all", returns the list of all variables in a formula, stored in self.Vars_
    # if cat is an integer between 0 and 2, returns the list of variables v such that v.cat=cat
    if cat == "all":
        return self.Vars_
    else:
        res = []
        for v in self.Vars_:
            if v.cat == cat:
                res.append(v)
        return res