def _build_model_files(self, bin_name):
        """ wrap call to model.py to generate the markov model, rules and
        templates from the cluster calculated by PRISMA.
        """
        data_dir = os.path.join(self.models_dir, bin_name, bin_name)
        m = ModelFilesGenerator(data_dir, self.order, self.ngram,
                                urllib.unquote(self.whitespace), self.subrules)

        m.saveModel()
        if self.dograph:
            import pygraphviz
            if self.minimize:
                graph = m.minimizeModel()
            else:
                graph = m.mc
            if self.colorFieldStates:
                m.setColorStates()
                G = pygraphviz.AGraph(directed=True)
                cs = set(m.colorStates)
                print "Colouring {} states:".format(len(cs))
                for node, neighs in graph.items():
                    if node in cs:
                        print node
                        if node.endswith("UAC"):
                            G.add_node(node, style="filled", fillcolor="grey")
                        if node.endswith("UAS"):
                            G.add_node(node, style="filled", fillcolor="pink")
                    else:
                        G.add_node(node)
                for node, neighs in graph.items():
                    for neig in neighs:
                        G.add_edge(node, neig)
            else:
                G = pygraphviz.AGraph(graph, directed=True)
            G.draw(data_dir % "%s.eps", prog="dot")
            G.write("%s.dot" % data_dir)
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/model.py/ModelGenerator._build_model_files/swapped operands of `%`