code: def pegelsfcast_C(h, obj, npaths=None, level=None, bootstrap=None):
      forecast = np.full(h, fill_value=np.nan)
      states = obj["states"][-1, :]
      etype, ttype, stype = [
          switch(comp) for comp in obj["components"][:3]
      ]
      phi = 1 if obj["components"][3] == "N" else obj["par"][3]
      m = obj["m"]
      etsforecast(
          x=states,
          m=m,
          trend=ttype,
          season=stype,
          phi=phi,
          h=h,
          f=forecast,
      )
      return forecast
  
imports: import math
  from collections import namedtuple
  from typing import Tuple
  import numpy
  from numba import njit
  from numba.typed import List
  from statsmodels.tsa.seasonal import seasonal_decompose
  from .utils import _calculate_intervals, CACHE, NOGIL
label_desc: Use image node_id 22 for calling a global function with example usage: pegelsfcast_C(h, obj, npaths, level, bootstrap) and returns: forecast