code: def harch_recursion_python(
      parameters: Float64Array,
      resids: Float64Array,
      sigma2: Float64Array,
      lags: Int32Array,
      nobs: int,
      backcast: float,
      var_bounds: Float64Array,
  ) -> Float64Array:
      """
      Parameters
      ----------
      parameters : ndarray
          Model parameters
      resids : ndarray
          Residuals to use in the recursion
      sigma2 : ndarray
          Conditional variances with same shape as resids
      lags : ndarray
          Lag lengths in the HARCH
      nobs : int
          Length of resids
      backcast : float
          Value to use when initializing the recursion
      var_bounds : ndarray
          nobs by 2-element array of upper and lower bounds for conditional
          variances for each time period
      """
  
      for t in range(nobs):
          sigma2[t] = parameters[0]
          for i in range(lags.shape[0]):
              param = parameters[i + 1] / lags[i]
              for j in range(lags[i]):
                  if (t - j - 1) >= 0:
                      sigma2[t] += (
                          param * resids[t - j - 1] * resids[t - j - 1]
                      )
                  else:
                      sigma2[t] += param * backcast
  
          sigma2[t] = bounds_check(sigma2[t], var_bounds[t])
  
      return sigma2
  
imports: from __future__ import annotations
  from arch.compat.numba import jit
  from abc import ABCMeta, abstractmethod
  from typing import cast
  import numpy
  from scipy.special import gammaln
  from arch.typing import Float64Array, Int32Array
  from arch.utility.array import AbstractDocStringInheritor
label_desc: Use image node_id 3 for calling a global function with example usage: harch_recursion_python(parameters, resids, sigma2, lags, nobs, backcast, var_bounds) and returns: sigma2