code: def relational_create_graph_features(
      is_directed=False, edge_weights=False
  ):
      # RGCN, relational node mappers
      r1 = {"label": "r1"}
      r2 = {"label": "r2"}
      features = np.array([[1, 1], [1, 0], [0, 1]])
      nodes = pd.DataFrame(features, index=["a", "b", "c"])
      edges = {
          "r1": pd.DataFrame(
              [("a", "b"), ("b", "c")], columns=["source", "target"]
          ),
          "r2": pd.DataFrame(
              [("a", "c")], columns=["source", "target"], index=[2]
          ),
      }
      if edge_weights:
          edges["r1"]["weight"] = [2.0, 0.5]
  
      SG = StellarDiGraph if is_directed else StellarGraph
      return SG(nodes, edges), features
  
imports: from stellargraph import StellarGraph, StellarDiGraph, IndexedArray
  import networkx
  import pandas
  import numpy
  import random
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: relational_create_graph_features(is_directed, edge_weights) and returns: SG,  features