code: def _get_degree_fn(graph) -> Callable:
      """Gets the function to calculate the graph node degree"""
      fn = (
          _weighted_directed_degree
          if nx.classes.function.is_weighted(graph)
          else _unweighted_undirected_degree
      )
      fn = partial(fn, graph=graph)
  
      return fn
  
file_path: karateclub/karateclub/graph_embedding/feathergraph.py
imports: import math
  from functools import partial
  from typing import List, Callable
  import numpy
  import networkx
  import scipy.sparse
  from karateclub.estimator import Estimator
label_desc: Use image node_id 3 for calling a global function with example usage: _get_degree_fn(graph) and returns: fn