code: def _get_edge_fn(graph) -> Callable:
      fn = (
          _directed
          if nx.classes.function.is_directed(graph)
          else _undirected
      )
  
      fn = partial(fn, graph=graph)
      return fn
  
imports: import random
  from functools import partial
  from typing import List, Callable
  import numpy
  import networkx
label_desc: Use image node_id 4 for calling a global function with example usage: _get_edge_fn(graph) and returns: fn