code: def is_branching(G):
      """
      Returns True if `G` is a branching.
  
      A branching is a directed forest with maximum in-degree equal to 1.
  
      Parameters
      ----------
      G : directed graph
          The directed graph to test.
  
      Returns
      -------
      b : bool
          A boolean that is True if `G` is a branching.
  
      Examples
      --------
      >>> G = nx.DiGraph([(0, 1), (1, 2), (2, 3), (3, 4)])
      >>> nx.is_branching(G)
      True
      >>> G.remove_edge(2, 3)
      >>> G.add_edge(3, 1)  # maximum in-degree is 2
      >>> nx.is_branching(G)
      False
  
      Notes
      -----
      In another convention, a branching is also known as a *forest*.
  
      See Also
      --------
      is_forest
  
      """
      return is_forest(G) and max(d for n, d in G.in_degree()) <= 1
  
imports: import networkx
label_desc: Use image node_id 2 for calling a global function with example usage: is_branching(G) and returns: unknown