code: def _calculate_numerical_distributions(
      self,
      observations: np.ndarray,
      low: float,
      high: float,
      step: Optional[float],
      parameters: _ParzenEstimatorParameters,
  ) -> _BatchedDistributions:
      step_or_0 = step or 0
  
      mus = observations
      consider_prior = (
          parameters.consider_prior or len(observations) == 0
      )
  
      def compute_sigmas() -> np.ndarray:
          if parameters.multivariate:
              SIGMA0_MAGNITUDE = 0.2
              sigma = (
                  SIGMA0_MAGNITUDE
                  * max(len(observations), 1)
                  ** (-1.0 / (len(self._search_space) + 4))
                  * (high - low + step_or_0)
              )
              sigmas = np.full(
                  shape=(len(observations),), fill_value=sigma
              )
          else:
              # TODO(contramundum53): Remove dependency on prior_mu
              prior_mu = 0.5 * (low + high)
              mus_with_prior = (
                  np.append(mus, prior_mu) if consider_prior else mus
              )
  
              sorted_indices = np.argsort(mus_with_prior)
              sorted_mus = mus_with_prior[sorted_indices]
              sorted_mus_with_endpoints = np.empty(
                  len(mus_with_prior) + 2, dtype=float
              )
              sorted_mus_with_endpoints[0] = low - step_or_0 / 2
              sorted_mus_with_endpoints[1:-1] = sorted_mus
              sorted_mus_with_endpoints[-1] = high + step_or_0 / 2
  
              sorted_sigmas = np.maximum(
                  sorted_mus_with_endpoints[1:-1]
                  - sorted_mus_with_endpoints[0:-2],
                  sorted_mus_with_endpoints[2:]
                  - sorted_mus_with_endpoints[1:-1],
              )
  
              if (
                  not parameters.consider_endpoints
                  and sorted_mus_with_endpoints.shape[0] >= 4
              ):
                  sorted_sigmas[0] = (
                      sorted_mus_with_endpoints[2]
                      - sorted_mus_with_endpoints[1]
                  )
                  sorted_sigmas[-1] = (
                      sorted_mus_with_endpoints[-2]
                      - sorted_mus_with_endpoints[-3]
                  )
  
              sigmas = sorted_sigmas[np.argsort(sorted_indices)][
                  : len(observations)
              ]
  
          # We adjust the range of the 'sigmas' according to the 'consider_magic_clip' flag.
          maxsigma = 1.0 * (high - low + step_or_0)
          if parameters.consider_magic_clip:
              # TODO(contramundum53): Remove dependency of minsigma on consider_prior.
              minsigma = (
                  1.0
                  * (high - low + step_or_0)
                  / min(
                      100.0, (1.0 + len(observations) + consider_prior)
                  )
              )
          else:
              minsigma = EPS
          return np.asarray(np.clip(sigmas, minsigma, maxsigma))
  
      sigmas = compute_sigmas()
  
      if consider_prior:
          prior_mu = 0.5 * (low + high)
          prior_sigma = 1.0 * (high - low + step_or_0)
          mus = np.append(mus, [prior_mu])
          sigmas = np.append(sigmas, [prior_sigma])
  
      if step is None:
          return _BatchedTruncNormDistributions(mus, sigmas, low, high)
      else:
          return _BatchedDiscreteTruncNormDistributions(
              mus, sigmas, low, high, step
          )
  
imports: from typing import Callable
  from typing import Dict
  from typing import NamedTuple
  from typing import Optional
  import numpy
  from optuna.distributions import BaseDistribution
  from optuna.distributions import CategoricalChoiceType
  from optuna.distributions import CategoricalDistribution
  from optuna.distributions import FloatDistribution
  from optuna.distributions import IntDistribution
  from optuna.samplers._tpe.probability_distributions import _BatchedCategoricalDistributions
  from optuna.samplers._tpe.probability_distributions import _BatchedDiscreteTruncNormDistributions
  from optuna.samplers._tpe.probability_distributions import _BatchedDistributions
  from optuna.samplers._tpe.probability_distributions import _BatchedTruncNormDistributions
  from optuna.samplers._tpe.probability_distributions import _MixtureOfProductDistribution
label_desc: Use image node_id 10 for calling the _ParzenEstimator obj's underlying member method code with example usage: obj._calculate_numerical_distributions(observations, low, high, step, parameters) and returns: np, _BatchedTruncNormDistributions, _BatchedDiscreteTruncNormDistributions