code: def _get_graph(
      n_nodes, n_features, n_edge_features=None, sparse=False
  ):
      x = np.random.rand(n_nodes, n_features)
      a = np.random.randint(0, 2, (n_nodes, n_nodes)).astype("f4")
      e = (
          np.random.rand(np.count_nonzero(a), n_edge_features)
          if n_edge_features is not None
          else None
      )
      if sparse:
          a = sp.csr_matrix(a)
      return Graph(x=x, a=a, e=e)
  
file_path: spektral/tests/test_models/core.py
imports: import numpy
  import scipy.sparse
  import tensorflow
  from spektral.data import Dataset, Graph, loaders
label_desc: Use image node_id 1 for calling a global function with example usage: _get_graph(n_nodes, n_features, n_edge_features, sparse) and returns: Graph