code: def _custom_count_nodes_vertically(graph):
      # Counts the number of vertical nodes in the same layers.
      layer_count = {}
      for n in graph.nodes:
          if graph.nodes[n]["layer"] not in layer_count:
              layer_count[graph.nodes[n]["layer"]] = 0
  
          layer_count[graph.nodes[n]["layer"]] += 1
  
      return np.max([v for v in layer_count.items()])
  
file_path: dowhy/dowhy/utils/networkx_plotting.py
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple, Union
  import matplotlib.pyplot
  import networkx
  import numpy
  import pandas
  from networkx.drawing import nx_pydot
label_desc: Use image node_id 4 for calling a global function with example usage: _custom_count_nodes_vertically(graph) and returns: np