code: def _make_edges_3d(n_x, n_y, n_z=1):
      """Returns a list of edges for a 3D image.
  
      Parameters
      ----------
      n_x : int
          The size of the grid in the x direction.
      n_y : int
          The size of the grid in the y direction.
      n_z : integer, default=1
          The size of the grid in the z direction, defaults to 1
      """
      vertices = np.arange(n_x * n_y * n_z).reshape((n_x, n_y, n_z))
      edges_deep = np.vstack(
          (vertices[:, :, :-1].ravel(), vertices[:, :, 1:].ravel())
      )
      edges_right = np.vstack(
          (vertices[:, :-1].ravel(), vertices[:, 1:].ravel())
      )
      edges_down = np.vstack(
          (vertices[:-1].ravel(), vertices[1:].ravel())
      )
      edges = np.hstack((edges_deep, edges_right, edges_down))
      return edges
  
imports: from itertools import product
  from numbers import Integral, Number, Real
  import numpy
  from numpy.lib.stride_tricks import as_strided
  from scipy import sparse
  from ..base import BaseEstimator, TransformerMixin, _fit_context
  from ..utils import check_array, check_random_state
  from ..utils._param_validation import Hidden, Interval, RealNotInt, validate_params
label_desc: Use image node_id 1 for calling a global function with example usage: _make_edges_3d(n_x, n_y, n_z) and returns: edges