code: def random_non_singular(
      p, sing_min=1.0, sing_max=2.0, random_state=0
  ):
      """Generate a random nonsingular matrix.
  
      Parameters
      ----------
      p : int
          The first dimension of the array.
  
      sing_min : float, optional (default to 1.)
          Minimal singular value.
  
      sing_max : float, optional (default to 2.)
          Maximal singular value.
  
      random_state : int or numpy.random.RandomState instance, optional
          random number generator, or seed.
  
      Returns
      -------
      output : numpy.ndarray, shape (p, p)
          A nonsingular matrix with the given minimal and maximal singular
          values.
      """
      rand_gen = np.random.default_rng(random_state)
      diag = random_diagonal(
          p, v_min=sing_min, v_max=sing_max, random_state=random_state
      )
      mat1 = rand_gen.standard_normal((p, p))
      mat2 = rand_gen.standard_normal((p, p))
      unitary1, _ = linalg.qr(mat1)
      unitary2, _ = linalg.qr(mat2)
      return unitary1.dot(diag).dot(unitary2.T)
  
imports: import copy
  import warnings
  from math import cosh, exp, log, sinh, sqrt
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from pandas import DataFrame
  from scipy import linalg
  from sklearn.covariance import EmpiricalCovariance, LedoitWolf
  from nilearn._utils.extmath import is_spd
  from nilearn.connectome.connectivity_matrices import ConnectivityMeasure, _check_spd, _check_square, _form_symmetric, _geometric_mean, _map_eigenvalues, prec_to_partial, sym_matrix_to_vec, vec_to_sym_matrix
  from nilearn.tests.test_signal import generate_signals
label_desc: Use image node_id 15 for calling a global function with example usage: random_non_singular(p, sing_min, sing_max, random_state) and returns: unitary1