code: def ramp_up_weights(
      total_num: int, flat_num: int, equal_weight: bool
  ) -> numpy.ndarray:
      """Adjust weights of observed trials.
  
      :param total_num: total number of observed trials.
      :param flat_num: the number of the most recent trials which
          get the full weight where the others will be applied with a linear ramp
          from 0 to 1.0. It will only take effect if equal_weight is False.
      :param equal_weight: whether all the observed trails share the same weights.
      """
      if total_num < flat_num or equal_weight:
          return numpy.ones(total_num)
  
      ramp_weights = numpy.linspace(
          1.0 / total_num, 1.0, num=total_num - flat_num
      )
      flat_weights = numpy.ones(flat_num)
      return numpy.concatenate([ramp_weights, flat_weights])
  
imports: from __future__ import annotations
  import logging
  from typing import Any, Callable, ClassVar, Iterable, Sequence, TypeVar
  import numpy
  from scipy.stats import norm
  from scipy.stats.distributions import rv_frozen
  from orion.algo.base import BaseAlgorithm
  from orion.algo.base.parallel_strategy import ParallelStrategy, strategy_factory
  from orion.algo.space import Integer, Real, Space
  from orion.core.utils import format_trials
  from orion.core.utils.flatten import flatten
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 2 for calling a global function with example usage: ramp_up_weights(total_num, flat_num, equal_weight) and returns: numpy, numpy