code: def weighted(a, b, c, d):
      nodes = pd.DataFrame(index=[1, 2, 3, 4])
      edges = pd.DataFrame(
          [(1, 2, a), (2, 3, b), (3, 4, c), (4, 1, d)],
          columns=["source", "target", "weight"],
      )
      return StellarGraph(nodes, edges)
  
imports: import numpy
  import pandas
  import pytest
  import networkx
  from stellargraph.data.explorer import BiasedRandomWalk
  from stellargraph.core.graph import StellarGraph
  from ..test_utils.graphs import create_test_graph, example_graph_random
label_desc: Use image node_id 2 for calling a global function with example usage: weighted(a, b, c, d) and returns: StellarGraph