code: def collatz_problem_digraph(nmax):
      def f(n):
          if n % 2 == 0:
              return n // 2
          else:
              return 3 * n + 1
  
      return discrete_dynamics_digraph(nmax, f)
  
file_path: networkx/examples/algorithms/plot_iterated_dynamical_systems.py
imports: import networkx
label_desc: Use image node_id 9 for calling a global function with example usage: collatz_problem_digraph(nmax) and returns: discrete_dynamics_digraph, unknown, unknown