code: def test_weighted_graph_label(self):
      g = nx.Graph()
      edges = [(1, 2), (2, 3), (3, 4), (4, 1)]
      g.add_edges_from(edges)
      g[1][2]["w"] = 1
      g[2][3]["w"] = 2
      g[3][4]["w"] = 3
      g[4][1]["w"] = 4
  
      g = StellarGraph.from_networkx(g, edge_weight_attr="w")
  
      nodes = list(g.nodes())
      n = 1
      length = 1
      seed = None
      p = 1.0
      q = 1.0
  
      biasedrw = BiasedRandomWalk(g)
  
      assert (
          len(
              biasedrw.run(
                  nodes=nodes,
                  n=n,
                  p=p,
                  q=q,
                  length=length,
                  seed=seed,
                  weighted=True,
              )
          )
          == 4
      )
  
      g = nx.Graph()
      edges = [(1, 2), (2, 3), (3, 4), (4, 1)]
      g.add_edges_from(edges)
      g[1][2]["wt"] = 1
      g[2][3]["wt"] = 2
      g[3][4]["wt"] = 3
      g[4][1]["wt"] = 4
  
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 5 for calling the TestBiasedWeightedRandomWalk obj's underlying member method code with example usage: obj.test_weighted_graph_label() without return types