code: def in_degree_centrality(G):
      """Compute the in-degree centrality for nodes.
  
      The in-degree centrality for a node v is the fraction of nodes its
      incoming edges are connected to.
  
      Parameters
      ----------
      G : graph
          A NetworkX graph
  
      Returns
      -------
      nodes : dictionary
          Dictionary of nodes with in-degree centrality as values.
  
      Raises
      ------
      NetworkXNotImplemented
          If G is undirected.
  
      Examples
      --------
      >>> G = nx.DiGraph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
      >>> nx.in_degree_centrality(G)
      {0: 0.0, 1: 0.3333333333333333, 2: 0.6666666666666666, 3: 0.6666666666666666}
  
      See Also
      --------
      degree_centrality, out_degree_centrality
  
      Notes
      -----
      The degree centrality values are normalized by dividing by the maximum
      possible degree in a simple graph n-1 where n is the number of nodes in G.
  
      For multigraphs or graphs with self loops the maximum degree might
      be higher than n-1 and values of degree centrality greater than 1
      are possible.
      """
      if len(G) <= 1:
          return {n: 1 for n in G}
  
      s = 1.0 / (len(G) - 1.0)
      centrality = {n: d * s for n, d in G.in_degree()}
      return centrality
  
imports: import networkx
  from networkx.utils.decorators import not_implemented_for
label_desc: Use image node_id 2 for calling a global function with example usage: in_degree_centrality(G) and returns: centrality, unknown