code: def _random_weights(n_features, lam, lam_perturb, prng):
      """Generate a symmetric random matrix with zeros along the diagnoal and
      non-zero elements take the value {lam * lam_perturb, lam / lam_perturb}
      with probability 1/2.
      """
      weights = np.zeros((n_features, n_features))
      n_off_diag = int((n_features**2 - n_features) / 2)
      berns = prng.binomial(1, 0.5, size=n_off_diag)
      vals = np.zeros(berns.shape)
      vals[berns == 0] = 1.0 * lam * lam_perturb
      vals[berns == 1] = 1.0 * lam / lam_perturb
      weights[np.triu_indices(n_features, k=1)] = vals
      weights[weights < 0] = 0
      weights = weights + weights.T
      return weights
  
imports: from __future__ import absolute_import
  import numpy
  from sklearn.base import BaseEstimator, clone
  from sklearn.utils import check_array, as_float_array
  from joblib import Parallel, delayed
  from functools import partial
  from .inverse_covariance import _init_coefs
  from .None import QuicGraphicalLasso
label_desc: Use image node_id 3 for calling a global function with example usage: _random_weights(n_features, lam, lam_perturb, prng) and returns: weights