class_docstr: Unit tests for the :func:`~networkx.stochastic_graph` function.
docstr: Tests for an in-place reweighting of the edges of the graph.
docstr_tok: ["Tests","for","an","in-place","reweighting","of","the","edges","of","the","graph","."]
code: def test_in_place(self):
      """Tests for an in-place reweighting of the edges of the graph."""
      G = nx.DiGraph()
      G.add_edge(0, 1, weight=1)
      G.add_edge(0, 2, weight=1)
      nx.stochastic_graph(G, copy=False)
      assert sorted(G.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 2 for calling the TestStochasticGraph obj's underlying member method code with example usage: obj.test_in_place() without return types