code: def _select_interval(
      min_interval, max_interval, series_length, rng, method=3
  ):
      """Private function used to select an interval for a single tree."""
      interval = np.empty(2, dtype=int)
      if method == 0:
          interval[0] = rng.randint(series_length - min_interval)
          interval[1] = rng.randint(
              interval[0] + min_interval, series_length
          )
      else:
          if rng.randint(2):
              interval[0] = rng.randint(series_length - min_interval)
              interval_range = min(
                  series_length - interval[0], max_interval
              )
              length = rng.randint(min_interval, interval_range)
              interval[1] = interval[0] + length
          else:
              interval[1] = rng.randint(min_interval, series_length)
              interval_range = min(interval[1], max_interval)
              length = (
                  3
                  if interval_range == min_interval
                  else rng.randint(min_interval, interval_range)
              )
              interval[0] = interval[1] - length
      return interval
  
imports: import numpy
  from joblib import Parallel, delayed
  from sklearn.base import clone
  from sklearn.ensemble._base import _partition_estimators
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils.validation import check_random_state
  from sktime.classification.base import BaseClassifier
label_desc: Use image node_id 5 for calling a global function with example usage: _select_interval(min_interval, max_interval, series_length, rng, method) and returns: interval