code: def test_output_format_dim(n_timepoints, n_instances, n_intervals):
      """Test output format and dimensions."""
      X = _make_nested_from_array(
          np.ones(n_timepoints), n_instances=n_instances, n_columns=1
      )
  
      trans = RandomIntervalSegmenter(n_intervals=n_intervals)
      Xt = trans.fit_transform(X)
  
      # Check number of rows and output type.
      assert isinstance(Xt, pd.DataFrame)
      assert Xt.shape[0] == X.shape[0]
  
      # Check number of generated intervals/columns.
      if n_intervals != "random":
          if np.issubdtype(type(n_intervals), np.floating):
              assert Xt.shape[1] <= np.maximum(
                  1, int(n_timepoints * n_intervals)
              )
          elif np.issubdtype(type(n_intervals), np.integer):
              assert Xt.shape[1] <= n_intervals
          elif n_intervals == "sqrt":
              assert Xt.shape[1] <= np.maximum(
                  1, int(np.sqrt(n_timepoints))
              )
          elif n_intervals == "log":
              assert Xt.shape[1] <= np.maximum(
                  1, int(np.log(n_timepoints))
              )
  
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 1 for calling a global function with example usage: test_output_format_dim(n_timepoints, n_instances, n_intervals) without return types