code: def ornstein_uhlenbeck_levels(
      params: "ModelParameters",
  ) -> "np.array":
      """Constructs the rate levels of a mean-reverting Ornstein-Uhlenbeck
      process.
  
      Parameters
      ----------
      params : ModelParameters
          The parameters for the stochastic model.
  
      Returns
      -------
      `np.array`
          The interest rate levels for the Ornstein Uhlenbeck process
      """
      ou_levels = [params.all_r0]
      brownian_motion_returns = brownian_motion_log_returns(params)
      for i in range(1, params.all_time):
          drift = (
              params.ou_a
              * (params.ou_mu - ou_levels[i - 1])
              * params.all_delta
          )
          randomness = brownian_motion_returns[i - 1]
          ou_levels.append(ou_levels[i - 1] + drift + randomness)
      return np.array(ou_levels)
  
imports: import numpy
  import pandas
  from stochastic.processes.noise import GaussianNoise
  from tensortrade.stochastic.processes.brownian_motion import brownian_motion_log_returns
  from tensortrade.stochastic.utils.helpers import get_delta, scale_times_to_generate
  from tensortrade.stochastic.utils.parameters import ModelParameters, default
label_desc: Use image node_id 1 for calling a global function with example usage: ornstein_uhlenbeck_levels(params) and returns: np