@staticmethod
def _get_len_out(di_graph, rule):
    """Get the number of out edges of a rule (more exactly, the non         terminal at its left.

        Parameters
        ----------
        di_graph : DiGraph
            A directed graph
        rule : :class:`~pyformlang.indexed_grammar.ReducedRule`
            The rule
        """
    if rule.left_term in di_graph:
        return len(di_graph[rule.left_term])
    return 0
