code: def _random_simple_graph(
      idtype, dtype, ctx, M, N, max_nnz, srctype, dsttype, etype
  ):
      src = np.random.randint(0, M, (max_nnz,))
      dst = np.random.randint(0, N, (max_nnz,))
      val = np.random.randn(max_nnz)
      a = ssp.csr_matrix((val, (src, dst)), shape=(M, N))
      a.sum_duplicates()
      a = a.tocoo()
      # shuffle edges
      perm = np.random.permutation(a.nnz)
      row = a.row[perm]
      col = a.col[perm]
      val = a.data[perm]
      a = ssp.csr_matrix((val, (row, col)), shape=(M, N))
  
      A = dgl.heterograph(
          {
              (srctype, etype, dsttype): (
                  F.copy_to(F.tensor(row, dtype=idtype), ctx),
                  F.copy_to(F.tensor(col, dtype=idtype), ctx),
              )
          },
          num_nodes_dict={srctype: a.shape[0], dsttype: a.shape[1]},
      )
      A.edata["w"] = F.copy_to(F.tensor(val, dtype=dtype), ctx)
      return a, A
  
file_path: dgl/tests/python/common/test_sparse_ops-csr.py
imports: import backend
  import dgl
  import numpy
  import pytest
  import scipy.sparse
  from utils import parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: _random_simple_graph(idtype, dtype, ctx, M, N, max_nnz, srctype, dsttype, etype) and returns: a,  A