docstr: Test that w_range is respected in output
docstr_tok: ["Test","that","w_range","is","respected","in","output"]
code: def test_weight_range(self, num_nodes, degree, w_range):
      """Test that w_range is respected in output"""
      w_min = w_range[0]
      w_max = w_range[1]
      sm = generate_structure(
          num_nodes, degree, w_min=w_min, w_max=w_max
      )
      assert all(abs(sm[u][v]["weight"]) >= w_min for u, v in sm.edges)
      assert all(abs(sm[u][v]["weight"]) <= w_max for u, v in sm.edges)
  
imports: import operator
  from typing import Hashable, Tuple, Union
  import networkx
  import numpy
  import pandas
  import pytest
  from networkx.algorithms.dag import is_directed_acyclic_graph
  from sklearn.gaussian_process.kernels import RBF
  from causalnex.structure.data_generators.core import _sample_binary_from_latent, _sample_count_from_latent, _sample_poisson, generate_structure, nonlinear_sem_generator, sem_generator
  from causalnex.structure.structuremodel import StructureModel
label_desc: Use image node_id 5 for calling the TestGenerateStructure obj's underlying member method code with example usage: obj.test_weight_range(num_nodes, degree, w_range) without return types