code: def test_rand_intervals_fixed_n_min_max_length(
      n_intervals, min_length, max_length
  ):
      """Test random interval length."""
      n_timepoints = 30
      x = np.arange(n_timepoints)
  
      intervals = _rand_intervals_fixed_n(
          x,
          n_intervals=n_intervals,
          min_length=min_length,
          max_length=max_length,
      )
      lengths = (
          intervals[:, 1] - intervals[:, 0]
      )  # length = end - start
      assert np.all(lengths >= min_length)
      assert np.all(lengths <= max_length)
  
file_path: sktime/sktime/transformations/panel/tests/test_segment.py
imports: import numpy
  import pandas
  import pytest
  from sktime.transformations.panel.segment import RandomIntervalSegmenter, _rand_intervals_fixed_n, _rand_intervals_rand_n
  from sktime.utils._testing.panel import _make_nested_from_array
label_desc: Use image node_id 5 for calling a global function with example usage: test_rand_intervals_fixed_n_min_max_length(n_intervals, min_length, max_length) without return types