code: def draw_networkx_nodes(
      G,
      pos,
      nodelist=None,
      node_size=300,
      node_color="#1f78b4",
      node_shape="o",
      alpha=None,
      cmap=None,
      vmin=None,
      vmax=None,
      ax=None,
      linewidths=None,
      edgecolors=None,
      label=None,
      margins=None,
  ):
      """Draw the nodes of the graph G.
  
      This draws only the nodes of 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.
  
      ax : Matplotlib Axes object, optional
          Draw the graph in the specified Matplotlib axes.
  
      nodelist : list (default list(G))
          Draw only specified nodes
  
      node_size : scalar or array (default=300)
          Size of nodes.  If an array it must be the same length as nodelist.
  
      node_color : color or array of colors (default='#1f78b4')
          Node color. Can be a single color or a sequence of colors with the same
          length as nodelist. Color can be string or rgb (or rgba) tuple of
          floats from 0-1. If numeric values are specified they will be
          mapped to colors using the cmap and vmin,vmax parameters. See
          matplotlib.scatter for more details.
  
      node_shape :  string (default='o')
          The shape of the node.  Specification is as matplotlib.scatter
          marker, one of 'so^>v<dph8'.
  
      alpha : float or array of floats (default=None)
          The node transparency.  This can be a single alpha value,
          in which case it will be applied to all the nodes of color. Otherwise,
          if it is an array, the elements of alpha will be applied to the colors
          in order (cycling through alpha multiple times if necessary).
  
      cmap : Matplotlib colormap (default=None)
          Colormap for mapping intensities of nodes
  
      vmin,vmax : floats or None (default=None)
          Minimum and maximum for node colormap scaling
  
      linewidths : [None | scalar | sequence] (default=1.0)
          Line width of symbol border
  
      edgecolors : [None | scalar | sequence] (default = node_color)
          Colors of node borders. Can be a single color or a sequence of colors with the
          same length as nodelist. Color can be string or rgb (or rgba) tuple of floats
          from 0-1. If numeric values are specified they will be mapped to colors
          using the cmap and vmin,vmax parameters. See `~matplotlib.pyplot.scatter` for more details.
  
      label : [None | string]
          Label for legend
  
      margins : float or 2-tuple, optional
          Sets the padding for axis autoscaling. Increase margin to prevent
          clipping for nodes that are near the edges of an image. Values should
          be in the range ``[0, 1]``. See :meth:`matplotlib.axes.Axes.margins`
          for details. The default is `None`, which uses the Matplotlib default.
  
      Returns
      -------
      matplotlib.collections.PathCollection
          `PathCollection` of the nodes.
  
      Examples
      --------
      >>> G = nx.dodecahedral_graph()
      >>> nodes = nx.draw_networkx_nodes(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_edges
      draw_networkx_labels
      draw_networkx_edge_labels
      """
      from collections.abc import Iterable
  
      import matplotlib as mpl
      import matplotlib.collections  # call as mpl.collections
      import matplotlib.pyplot as plt
      import numpy as np
  
      if ax is None:
          ax = plt.gca()
  
      if nodelist is None:
          nodelist = list(G)
  
      if len(nodelist) == 0:  # empty nodelist, no drawing
          return mpl.collections.PathCollection(None)
  
      try:
          xy = np.asarray([pos[v] for v in nodelist])
      except KeyError as err:
          raise nx.NetworkXError(
              f"Node {err} has no position."
          ) from err
  
      if isinstance(alpha, Iterable):
          node_color = apply_alpha(
              node_color, alpha, nodelist, cmap, vmin, vmax
          )
          alpha = None
  
      node_collection = ax.scatter(
          xy[:, 0],
          xy[:, 1],
          s=node_size,
          c=node_color,
          marker=node_shape,
          cmap=cmap,
          vmin=vmin,
          vmax=vmax,
          alpha=alpha,
          linewidths=linewidths,
          edgecolors=edgecolors,
          label=label,
      )
      ax.tick_params(
          axis="both",
          which="both",
          bottom=False,
          left=False,
          labelbottom=False,
          labelleft=False,
      )
  
      if margins is not None:
          if isinstance(margins, Iterable):
              ax.margins(*margins)
          else:
              ax.margins(margins)
  
      node_collection.set_zorder(2)
      return node_collection
  
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 3 for calling a global function with example usage: draw_networkx_nodes(G, pos, nodelist, node_size, node_color, node_shape, alpha, cmap, vmin, vmax, ax, linewidths, edgecolors, label, margins) and returns: node_collection, mpl