code: def generate_olh_samples(
      space: Space,
      n_levels: int,
      strength: int,
      index: int,
      rng: RandomState,
  ) -> tuple[np.array, int]:
      """
      Generates samples from an orthogonal Latin hypercube (OLH)
  
      Parameters
      ----------
      space: `orion.core.worker.Space`
          Parameter space
      n_levels: int
          Number of levels
      strength: {1,2}
          Strength parameter for an orthogonal Latin hypercube
      rng: None or ``numpy.random.RandomState``
          Random number generator
  
      Returns
      -------
      (numpy.array, int) A tuple of the samples array from the normalized parameter space,
          and the n_levels parameter, which may be changed to suit the OLH requirements.
      """
  
      dimensions = len(space.items())
      if not _is_prime(n_levels):
          n_levels = _find_n_levels(dimensions)
          logger.warning(
              """WARNING: n_levels specified is not a prime number.
              Changing n_levels to %d""",
              n_levels,
          )
      elif n_levels < dimensions - 1:
          n_levels = _find_n_levels(dimensions)
          logger.warning(
              """WARNING: n_levels specified is less than the number of hyperparameters
              minus 1. Changing n_levels to %d""",
              n_levels,
          )
      n_rows = n_levels**strength
      logger.debug(
          "MOFA: setting number of trials in this iteration to %d",
          n_rows * index,
      )
      all_samples = []
      for _ in range(index):
          lhc = LatinHypercube(
              d=dimensions, strength=strength, seed=rng
          )
          samples = lhc.random(n_rows).tolist()
          all_samples.extend(samples)
  
      return np.array(all_samples), n_levels
  
file_path: orion/src/orion/algo/mofa/sampler.py
imports: from __future__ import annotations
  import logging
  import numpy
  from numpy.random import RandomState
  from scipy.stats.qmc import LatinHypercube
  from orion.algo.space import Space
label_desc: Use image node_id 3 for calling a global function with example usage: generate_olh_samples(space, n_levels, strength, index, rng) and returns: np,  n_levels