code: def frozen_trial_factory(
      number: int,
      values: List[float],
      dist: optuna.distributions.BaseDistribution = optuna.distributions.FloatDistribution(
          1.0, 100.0
      ),
      value_fn: Optional[Callable[[int], Union[int, float]]] = None,
      state_fn: Callable[
          [int], optuna.trial.TrialState
      ] = lambda _: optuna.trial.TrialState.COMPLETE,
  ) -> optuna.trial.FrozenTrial:
      if value_fn is None:
          value = random.random() * 99.0 + 1.0
      else:
          value = value_fn(number)
  
      trial = optuna.trial.FrozenTrial(
          number=number,
          trial_id=number,
          state=optuna.trial.TrialState.COMPLETE,
          value=None,
          datetime_start=None,
          datetime_complete=None,
          params={"param-a": value},
          distributions={"param-a": dist},
          user_attrs={},
          system_attrs={},
          intermediate_values={},
          values=values,
      )
      return trial
  
imports: import random
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Union
  from unittest.mock import patch
  from unittest.mock import PropertyMock
  import numpy
  import pytest
  import optuna
  from optuna.samplers import _tpe
  from optuna.samplers import TPESampler
label_desc: Use image node_id 15 for calling a global function with example usage: frozen_trial_factory(number, values, dist, value_fn, state_fn) and returns: trial