code: def make_seasonality(
      series_len,
      seasonality,
      method="discrete",
      order=3,
      duration=1,
      scale=0.05,
      seed=1,
  ):
      """Module to generate time-series seasonality with different methods
      series_len: int
          Total length of series
      seasonality: int
          For example, seasonality=52 would be a weekly series
      method: str ['discrete', 'fourier']
      order: int
          Used when method = 'fourier' ONLY. Fourier series order to generate seasonality.
      duration: int
          Used when method = 'discrete'. For example, seasonality=52 and duration=7 would be a daily
          series with a constant level on each week.
      scale: float
          Scale parameter of seasonality generation by Normal(0, scale). When method = 'discrete', it is directly used.
          when method = 'fourier', it is used to multiply with the sin-cosine wave generated series.
      seed: int
          Seed passed into `np.random.default_rng()`
      Returns
      -------
      np.array-llike
          Simulated seasonliaty with length equals `series_len`
  
      Notes
      -----
        1. In case of method = 'discrete', only `seasonality - 1` variables will be generated and the rest is
        directly derived to preserve the property of the sum of seasonality equals 1.
        2.  In case of method = 'fourier', see https://otexts.com/fpp2/complexseasonality.html
      """
      if seasonality > 1:
          if method == "fourier":
              t = np.arange(0, series_len)
              out = []
              for i in range(1, order + 1):
                  x = 2.0 * i * np.pi * t / seasonality
                  out.append(np.sin(x))
                  out.append(np.cos(x))
              out = np.column_stack(out)
              b = np.random.default_rng(seed).normal(
                  0, scale, order * 2
              )
              seas = np.matmul(out, b)
          else:
              # initialization
              seas = []
              iterations = math.ceil(series_len / duration)
              # initialize vector to be repeated
              init_seas = np.zeros(seasonality)
              init_seas[:-1] = np.random.default_rng(seed).normal(
                  0, scale, seasonality - 1
              )
              init_seas[seasonality - 1] = -1 * np.sum(init_seas)
              for idx in range(iterations):
                  seas += [init_seas[idx % seasonality]] * duration
              seas = np.array(seas[:series_len])
      else:
          seas = np.zeros(series_len)
      return seas
  
file_path: orbit/orbit/utils/simulation.py
imports: import numpy
  import pandas
  from statsmodels.tsa.arima_process import ArmaProcess
  import math
  from math import pi
  from orbit.exceptions import IllegalArgument
label_desc: Use image node_id 2 for calling a global function with example usage: make_seasonality(series_len, seasonality, method, order, duration, scale, seed) and returns: seas