code: def test_lattice_random_sign_true(self):
      n_features = 10
      alpha = 0.2
      prng = np.random.RandomState(1)
      adjacency = lattice(prng, n_features, alpha, random_sign=True)
  
      nnz = alpha * n_features
  
      # diagonal zero
      assert np.sum(adjacency[np.where(np.eye(n_features))]) == 0
  
      # some non-zeros are negative (random_sign=True)
      assert np.sum(adjacency[adjacency != 0] < 0) != np.sum(
          adjacency[adjacency != 0] != 0
      )
  
      # banded structure
      for nn in range(n_features):
          d = np.diag(np.ones((n_features - nn,)), k=nn)
  
          if nn == 0:
              continue
  
          elif nn <= nnz:
              assert np.sum(adjacency[np.where(d)]) != 0
  
          else:
              assert np.sum(adjacency[np.where(d)]) == 0
  
file_path: skggm/inverse_covariance/profiling/tests/graphs_test.py
imports: import numpy
  import pytest
  from inverse_covariance.profiling import lattice, blocks, ClusterGraph, ErdosRenyiGraph, LatticeGraph
label_desc: Use image node_id 2 for calling the TestGraphs obj's underlying member method code with example usage: obj.test_lattice_random_sign_true() without return types