code: def get_random_hts(S: np.ndarray, periods: int, freq: str):
      num_ts, num_bottom_ts = S.shape
      ts_at_bottom_level = random_ts(
          num_ts=num_bottom_ts,
          periods=periods,
          freq=freq,
      )
  
      hts = HierarchicalTimeSeries(
          ts_at_bottom_level=ts_at_bottom_level, S=S
      )
      return hts
  
file_path: gluonts/test/dataset/test_hierarchical.py
imports: import numpy
  import pandas
  from toolz.itertoolz import first
  import pytest
  from gluonts.dataset.hierarchical import HierarchicalTimeSeries
label_desc: Use image node_id 3 for calling a global function with example usage: get_random_hts(S, periods, freq) and returns: hts