code: def test_range_filter(profiler):
      filter = RangeProfilerFilter(profiler, min=10000)
      assert filter({"conv": 1})
      assert filter({"conv": 2})
      assert not filter({"conv": 0})
  
      filter = RangeProfilerFilter(profiler, max=30000)
      assert filter({"conv": 0})
      assert filter({"conv": 1})
      assert not filter({"conv": 2})
  
      filter = RangeProfilerFilter(profiler, min=10000, max=30000)
      assert not filter({"conv": 0})
      assert filter({"conv": 1})
      assert not filter({"conv": 2})
  
      with pytest.raises(ValueError, match="both None"):
          RangeProfilerFilter(profiler, min=None, max=None)
  
file_path: nni/test/algo/nas/oneshot/test_profiler.py
imports: import pytest
  import torch
  from torch.nn import Conv2d
  from nni.nas.nn import ModelSpace, LayerChoice
  from nni.nas.oneshot.pytorch.profiler import RangeProfilerFilter, ExpectationProfilerPenalty, SampleProfilerPenalty
  from nni.nas.profiler.pytorch.flops import FlopsProfiler
label_desc: Use image node_id 2 for calling a global function with example usage: test_range_filter(profiler) without return types