code: def test_random_weighted_sample():
      mapping = {"a": 10, "b": 20}
      s = random_weighted_sample(mapping, 2, seed=1)
      s = random_weighted_sample(mapping, 2)
      assert sorted(s) == sorted(mapping.keys())
      pytest.raises(ValueError, random_weighted_sample, mapping, 3)
  
imports: import pytest
  from networkx.utils import powerlaw_sequence, random_weighted_sample, weighted_choice, zipf_rv
label_desc: Use image node_id 3 for calling a global function with example usage: test_random_weighted_sample() without return types