def __str__(self):
        """If counter is finished, print out results, else print out the counter
        paths"""
        if not hasattr(self, "_results"):
            return self.__repr__()
        else:
            str_file = StringIO()
            try:
                for kind_key, inst_dict in self._results.iteritems():
                    print>>str_file, kind_key
                    for inst_key in inst_dict.iterkeys():
                        print>>str_file, "\t%s" % inst_key
                        counters,ticks = self.instticks(kind_key, inst_key)
                        print>>str_file, "\t",
                        for counter in counters:
                            print>>str_file, "    %s" % counter,
                        else:
                            print>>str_file, "\n"
                        for tick in ticks:
                            print>>str_file, "\t",
                            for index,data in enumerate(tick):
                                print>>str_file, str(data).rjust(len(counters[index])+4),
                            else:
                                print>>str_file, "\n",
                        else:
                            print>>str_file, "\n",
                    print>>str_file, "\n",
            finally:
                results = str_file.getvalue()
                str_file.close()
                return results
If counter is finished, print out results, else print out the counter
        paths
recipes/Python/303338_Helper_subclass/recipe-303338.py