code: def test_blocks_chain_blocks_true(self):
      prng = np.random.RandomState(1)
      n_block_features = 4
      n_blocks = 3
      block = np.ones((n_block_features, n_block_features))
  
      adjacency = blocks(
          prng, block, n_blocks=n_blocks, chain_blocks=True
      )
  
      n_features = n_block_features * n_blocks
  
      assert adjacency.shape[0] == n_features
  
      # diagonal zero
      assert np.sum(adjacency[np.where(np.eye(n_features))]) == 0
  
      # for each block, assert sum of the blocks minus the diagonal
      for nn in range(n_blocks):
          brange = slice(
              nn * n_block_features, (nn + 1) * n_block_features
          )
          assert (
              np.sum(adjacency[brange, brange])
              == n_block_features**2 - n_block_features
          )
  
      # assert that all nonzeros DO NOT equal sum of all blocks above
      assert (
          np.sum(adjacency.flat)
          != (n_block_features**2 - n_block_features) * n_blocks
      )
  
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 4 for calling the TestGraphs obj's underlying member method code with example usage: obj.test_blocks_chain_blocks_true() without return types