code: def draw_networkx_labels(
      G,
      pos,
      labels=None,
      font_size=12,
      font_color="k",
      font_family="sans-serif",
      font_weight="normal",
      alpha=None,
      bbox=None,
      horizontalalignment="center",
      verticalalignment="center",
      ax=None,
      clip_on=True,
  ):
      """Draw node labels on the graph G.
  
      Parameters
      ----------
      G : graph
          A networkx graph
  
      pos : dictionary
          A dictionary with nodes as keys and positions as values.
          Positions should be sequences of length 2.
  
      labels : dictionary (default={n: n for n in G})
          Node labels in a dictionary of text labels keyed by node.
          Node-keys in labels should appear as keys in `pos`.
          If needed use: `{n:lab for n,lab in labels.items() if n in pos}`
  
      font_size : int (default=12)
          Font size for text labels
  
      font_color : color (default='k' black)
          Font color string. Color can be string or rgb (or rgba) tuple of
          floats from 0-1.
  
      font_weight : string (default='normal')
          Font weight
  
      font_family : string (default='sans-serif')
          Font family
  
      alpha : float or None (default=None)
          The text transparency
  
      bbox : Matplotlib bbox, (default is Matplotlib's ax.text default)
          Specify text box properties (e.g. shape, color etc.) for node labels.
  
      horizontalalignment : string (default='center')
          Horizontal alignment {'center', 'right', 'left'}
  
      verticalalignment : string (default='center')
          Vertical alignment {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
  
      ax : Matplotlib Axes object, optional
          Draw the graph in the specified Matplotlib axes.
  
      clip_on : bool (default=True)
          Turn on clipping of node labels at axis boundaries
  
      Returns
      -------
      dict
          `dict` of labels keyed on the nodes
  
      Examples
      --------
      >>> G = nx.dodecahedral_graph()
      >>> labels = nx.draw_networkx_labels(G, pos=nx.spring_layout(G))
  
      Also see the NetworkX drawing examples at
      https://networkx.org/documentation/latest/auto_examples/index.html
  
      See Also
      --------
      draw
      draw_networkx
      draw_networkx_nodes
      draw_networkx_edges
      draw_networkx_edge_labels
      """
      import matplotlib.pyplot as plt
  
      if ax is None:
          ax = plt.gca()
  
      if labels is None:
          labels = {n: n for n in G.nodes()}
  
      text_items = {}  # there is no text collection so we'll fake one
      for n, label in labels.items():
          (x, y) = pos[n]
          if not isinstance(label, str):
              label = str(
                  label
              )  # this makes "1" and 1 labeled the same
          t = ax.text(
              x,
              y,
              label,
              size=font_size,
              color=font_color,
              family=font_family,
              weight=font_weight,
              alpha=alpha,
              horizontalalignment=horizontalalignment,
              verticalalignment=verticalalignment,
              transform=ax.transData,
              bbox=bbox,
              clip_on=clip_on,
          )
          text_items[n] = t
  
      ax.tick_params(
          axis="both",
          which="both",
          bottom=False,
          left=False,
          labelbottom=False,
          labelleft=False,
      )
  
      return text_items
  
file_path: networkx/networkx/drawing/nx_pylab.py
imports: from numbers import Number
  import networkx
  from networkx.drawing.layout import circular_layout, kamada_kawai_layout, planar_layout, random_layout, shell_layout, spectral_layout, spring_layout
label_desc: Use image node_id 5 for calling a global function with example usage: draw_networkx_labels(G, pos, labels, font_size, font_color, font_family, font_weight, alpha, bbox, horizontalalignment, verticalalignment, ax, clip_on) and returns: text_items