code: def compute_interval_length(
      capped_min_interval: int,
      current_interval_start: int,
      inner_intervals_step: int,
      interval_max_length: int,
      rng: RandomState,
  ) -> int:
      if (
          capped_min_interval
          < interval_max_length * (inner_intervals_step + 1)
          - current_interval_start
      ):
          current_interval_length = max(
              capped_min_interval,
              rng.randint(
                  interval_max_length * (inner_intervals_step + 1)
                  - current_interval_start
                  - 1,
              ),
          )
      elif (
          capped_min_interval
          == interval_max_length * (inner_intervals_step + 1)
          - current_interval_start
      ):
          current_interval_length = capped_min_interval
      else:
          highest_possible_interval_length = (
              interval_max_length * (inner_intervals_step + 1)
              - current_interval_start
          )
          raise ValueError(
              f"low({capped_min_interval}) > "
              f"high({highest_possible_interval_length}): "
              f"Decrease capped_min_interval({capped_min_interval}) "
              f"or increase interval_max_length({interval_max_length})"
          )
      return current_interval_length
  
file_path: sktime/sktime/series_as_features/base/estimators/interval_based/_tsf.py
imports: import math
  from typing import Optional
  import numpy
  from joblib import Parallel, delayed
  from numpy.random import RandomState
  from sklearn.utils.multiclass import class_distribution
  from sklearn.utils.validation import check_random_state
  from sktime.base._base import _clone_estimator
  from sktime.utils.slope_and_trend import _slope
  from sktime.utils.validation import check_n_jobs
label_desc: Use image node_id 2 for calling a global function with example usage: compute_interval_length(capped_min_interval, current_interval_start, inner_intervals_step, interval_max_length, rng) and returns: current_interval_length