code: def __init__(
      self,
      observations: Dict[str, np.ndarray],
      search_space: Dict[str, BaseDistribution],
      parameters: _ParzenEstimatorParameters,
      predetermined_weights: Optional[np.ndarray] = None,
  ) -> None:
      if parameters.consider_prior:
          if parameters.prior_weight is None:
              raise ValueError(
                  "Prior weight must be specified when consider_prior==True."
              )
          elif parameters.prior_weight <= 0:
              raise ValueError("Prior weight must be positive.")
  
      self._search_space = search_space
  
      transformed_observations = self._transform(observations)
  
      assert predetermined_weights is None or len(
          transformed_observations
      ) == len(predetermined_weights)
      weights = (
          predetermined_weights
          if predetermined_weights is not None
          else self._call_weights_func(
              parameters.weights, len(transformed_observations)
          )
      )
  
      if len(transformed_observations) == 0:
          weights = np.array([1.0])
      elif parameters.consider_prior:
          assert parameters.prior_weight is not None
          weights = np.append(weights, [parameters.prior_weight])
      weights /= weights.sum()
      self._mixture_distribution = _MixtureOfProductDistribution(
          weights=weights,
          distributions=[
              self._calculate_distributions(
                  transformed_observations[:, i],
                  param,
                  search_space[param],
                  parameters,
              )
              for i, param in enumerate(search_space)
          ],
      )
  
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 1 to create a new _ParzenEstimator object  with example: obj = _ParzenEstimator(observations, search_space, parameters, predetermined_weights)