code: def _sample_node(index_table, level, sampler):
      """Sample a number of nodes depending on the size of hierarchy and level."""
      nodes = np.arange(1, np.floor(len(index_table) / level) + 1, 1)
      # return a single sample of them
      sample_nodes = int(sampler.choice(nodes, size=1)[0])
  
      return sample_nodes
  
file_path: sktime/sktime/utils/_testing/hierarchical.py
imports: from itertools import product
  from typing import Tuple, Union
  import numpy
  import pandas
  from sklearn.utils import check_random_state
  from sktime.datasets import load_airline
  from sktime.utils._testing.series import _make_index
label_desc: Use image node_id 3 for calling a global function with example usage: _sample_node(index_table, level, sampler) and returns: sample_nodes