code: def linear_forgetting_weights(args, n):
      """
      Calculate decayed weights of N trials.
      """
      lf = args.linear_forgetting
      if n < lf:
          return np.ones(n)
      else:
          ramp = np.linspace(1.0 / n, 1.0, n - lf)
          flat = np.ones(lf)
          return np.concatenate([ramp, flat])
  
imports: from __future__ import annotations
  from collections import defaultdict
  import logging
  import math
  from typing import Any, NamedTuple
  import numpy
  from scipy.special import erf
  from typing_extensions import Literal
  import nni
  from nni.common.hpo_utils import Deduplicator, OptimizeMode, format_search_space, deformat_parameters, format_parameters
  from nni.tuner import Tuner
  from nni.utils import extract_scalar_reward
  from .None import random_tuner
label_desc: Use image node_id 7 for calling a global function with example usage: linear_forgetting_weights(args, n) and returns: np, np