class_docstr: Unit tests for the :func:`~networkx.stochastic_graph` function.
code: def test_arbitrary_weights(self):
      G = nx.DiGraph()
      G.add_edge(0, 1, weight=1)
      G.add_edge(0, 2, weight=1)
      S = nx.stochastic_graph(G)
      assert sorted(S.edges(data=True)) == [
          (0, 1, {"weight": 0.5}),
          (0, 2, {"weight": 0.5}),
      ]
  
file_path: networkx/networkx/generators/tests/test_stochastic.py
imports: import pytest
  import networkx
label_desc: Use image node_id 3 for calling the TestStochasticGraph obj's underlying member method code with example usage: obj.test_arbitrary_weights() without return types