code: def _rand_intervals_fixed_n(
      x, n_intervals, min_length=1, max_length=None, random_state=None
  ):
      """Sample a fixed number of intervals.
  
      Compute a fixed number (n) of intervals from index (x) with
      random starting points and lengths. Intervals may overlap and may
      not be unique.
  
      Parameters
      ----------
      x : array_like, shape = (n_timepoints,)
          Array containing the time-series index.
      n_intervals : 'sqrt', 'log', float or int
  
      Returns
      -------
      intervals : array-like, shape = (n_intervals, 2)
          2d array containing start and end points of intervals
      """
      rng = check_random_state(random_state)
      n_timepoints = x.shape[0]
      n_intervals = _get_n_from_n_timepoints(n_timepoints, n_intervals)
      starts = rng.randint(
          0, n_timepoints - min_length + 1, size=(n_intervals,)
      )
      if max_length is None:
          max_length = n_timepoints - starts
      ends = rng.randint(starts + min_length, starts + max_length + 1)
      return np.column_stack([starts, ends])
  
imports: import math
  import numpy
  import pandas
  from sklearn.utils import check_random_state
  from sktime.datatypes._utilities import get_time_index
  from sktime.transformations._delegate import _DelegatedTransformer
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import check_window_length
label_desc: Use image node_id 2 for calling a global function with example usage: _rand_intervals_fixed_n(x, n_intervals, min_length, max_length, random_state) and returns: np