code: def _template_sphere_disc(dim, outer_radius, inner_radius):
      r
      rmax = sp.array(outer_radius, ndmin=1)
      rmin = sp.array(inner_radius, ndmin=1)
      ind = 2 * rmax - 1
      coord = sp.indices((ind * sp.ones(dim, dtype=int)))
      coord = coord - (ind - 1)/2
      x = coord[0, :]
      y = coord[1, :]
      if dim == 2:
          img = (x ** 2 + y ** 2) < rmax ** 2
      elif dim == 3:
          z = coord[2, :]
          img = (x ** 2 + y ** 2 + z ** 2) < rmax ** 2
      if rmin[0] != 0:
          if dim == 2:
              img_min = (x ** 2 + y ** 2) > rmin ** 2
          elif dim == 3:
              img_min = (x ** 2 + y ** 2 + z ** 2) > rmin ** 2
          img = img * img_min
      return img
docs: r"""
      This private method generates an image array of a sphere/shell-disc/ring.
      It is useful for passing to Cubic networks as a ``template`` to make
      networks with desired shapes.
  
      Parameters
      ----------
      dim : int
          Network dimension
  
      outer_radius : int
          Number of the nodes in the outer radius of the network
  
      inner_radius : int
          Number of the nodes in the inner radius of the network
  
      Returns
      -------
      A Numpy array containing 1's to demarcate the desired shape, and 0's
      elsewhere.