code: def example_graph_random(
      feature_size=4,
      n_edges=20,
      n_nodes=6,
      n_isolates=1,
      is_directed=False,
      node_types=1,
      edge_types=1,
  ):
      # core/utils, link mapper, node mapper graph 3
  
      if is_directed:
          cls = StellarDiGraph
      else:
          cls = StellarGraph
  
      default_feature_size = 0
      if not isinstance(feature_size, dict):
          if isinstance(feature_size, int):
              default_feature_size = feature_size
          feature_size = {}
  
      def nodes(node_type):
          node_ids = range(
              n_nodes * node_type, n_nodes * (node_type + 1)
          )
          feat_dim = feature_size.get(node_type, default_feature_size)
          features = np.random.random((len(node_ids), feat_dim))
          return pd.DataFrame(features, index=node_ids)
  
      n_noniso = n_nodes - n_isolates
  
      def edges(edge_type):
          edge_ids = range(
              n_edges * edge_type, n_edges * (edge_type + 1)
          )
          # separately compute the within-type and type part of the node IDs for each edge, so that
          # each type has some isolated nodes (rather than just the last type)
          within_type = np.random.randint(
              0, n_noniso, size=(n_edges, 2)
          )
          which_type = np.random.randint(
              0, node_types, size=within_type.shape
          )
          return pd.DataFrame(
              within_type + which_type * n_nodes,
              columns=["source", "target"],
              index=edge_ids,
          )
  
      # string node types are more realistic
      return cls(
          {f"n-{nt}": nodes(nt) for nt in range(node_types)},
          {f"e-{et}": edges(et) for et in range(edge_types)},
      )
  
imports: from stellargraph import StellarGraph, StellarDiGraph, IndexedArray
  import networkx
  import pandas
  import numpy
  import random
  import pytest
label_desc: Use image node_id 10 for calling a global function with example usage: example_graph_random(feature_size, n_edges, n_nodes, n_isolates, is_directed, node_types, edge_types) and returns: cls, pd, pd