docs: def make_noise_image(shape, type='gaussian', mean=None, stddev=None,
                       random_state=None):
      """
      Make a noise image containing Gaussian or Poisson noise.
  
      Parameters
      ----------
      shape : 2-tuple of int
          The shape of the output 2D image.
  
      type : {'gaussian', 'poisson'}
          The distribution used to generate the random noise:
  
              * ``'gaussian'``: Gaussian distributed noise.
              * ``'poisson'``: Poisson distributed noise.
  
      mean : float
          The mean of the random distribution.  Required for both Gaussian
          and Poisson noise.  The default is 0.
  
      stddev : float, optional
          The standard deviation of the Gaussian noise to add to the
          output image.  Required for Gaussian noise and ignored for
          Poisson noise (the variance of the Poisson distribution is equal
          to its mean).
  
      random_state : int or `~numpy.random.RandomState`, optional
          Pseudo-random number generator state used for random sampling.
          Separate function calls with the same noise parameters and
          ``random_state`` will generate the identical noise image.
  
      Returns
      -------
      image : 2D `~numpy.ndarray`
          Image containing random noise.
  
      See Also
      --------
      apply_poisson_noise
  
      Examples
      --------
      .. plot::
          :include-source:
  
          # make Gaussian and Poisson noise images
          from photutils.datasets import make_noise_image
          shape = (100, 100)
          image1 = make_noise_image(shape, type='gaussian', mean=0., stddev=5.)
          image2 = make_noise_image(shape, type='poisson', mean=5.)
  
          # plot the images
          import matplotlib.pyplot as plt
          fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4))
          ax1.imshow(image1, origin='lower', interpolation='nearest')
          ax1.set_title('Gaussian noise ($\\mu=0$, $\\sigma=5.$)')
          ax2.imshow(image2, origin='lower', interpolation='nearest')
          ax2.set_title('Poisson noise ($\\mu=5$)')
      """
  
      if mean is None:
          raise ValueError('"mean" must be input')
  
      prng = check_random_state(random_state)
  
      if type == 'gaussian':
          if stddev is None:
              raise ValueError('"stddev" must be input for Gaussian noise')
          image = prng.normal(loc=mean, scale=stddev, size=shape)
      elif type == 'poisson':
          image = prng.poisson(lam=mean, size=shape)
      else:
          raise ValueError('Invalid type: {0}. Use one of '
                           '{"gaussian", "poisson"}.'.format(type))
  
      return image