class_docstr: Financial Holidays Transformer.
  
  This implementation wraps over holidays [1]_ by vacanza.
  
  Based on the index of ``X``, dates are extracted and passed to ``holidays``. Then
  upon generating the holiday information for that day (or absence of it) based on
  passed financial market information, a boolean series is prepared where ``True``
  indicates the date being a holiday and ``False`` otherwise. ``fit`` is a no-op for
  this transformer.
  
  Parameters
  ----------
  market : str
      An ISO 3166-1 Alpha-2 market code [2]_; not implemented for all countries (see
      documentation [3]_).
  years : Union[int, Iterable[int]], optional
      The year(s) to pre-calculate public holidays for at instantiation.
  expand : bool, optional
      Whether the entire year is calculated when one date from that year is
      requested.
  observed : bool, optional
      Whether to include the dates of when public holiday are observed (e.g. a
      holiday falling on a Sunday being observed the following Monday). False may not
      work for all countries.
  name : str, optional
      name of transformed series.
  
  References
  ----------
  .. [1] https://github.com/vacanza/python-holidays
  .. [2] https://www.iso20022.org/market-identifier-codes
  .. [3] https://python-holidays.readthedocs.io/en/latest/#available-financial-markets
  
  Notes
  -----
  If ``name`` is missing (by default), it is auto-populated as ``{market}_holidays``.
  
  Examples
  --------
  >>> from sktime.transformations.series.holiday import FinancialHolidaysTransformer
  >>>
  >>> import numpy
  >>> data = numpy.random.default_rng(seed=0).random(size=365)
  >>>
  >>> import pandas
  >>> index = pandas.date_range(start="2023-01-01", end="2023-12-31", freq="D")
  >>>
  >>> y = pandas.Series(data, index=index, name="random")
  >>>
  >>> y_t = FinancialHolidaysTransformer("XNYS").fit_transform(y)  # doctest: +SKIP
  >>> y_t.dtype  # doctest: +SKIP
  dtype('bool')
  >>> y_t.sum()  # doctest: +SKIP
  10
  >>> y_t.name  # doctest: +SKIP
  'XNYS_holidays'
docstr: Transform X and return a transformed version.
  
  private _transform containing the core logic, called from transform
  
  Parameters
  ----------
  X : Series or Panel of mtype X_inner_mtype
      if X_inner_mtype is list, _transform must support all types in it
      Data to be transformed
  y : Series or Panel, default=None
      Additional data, e.g., labels for transformation
  
  Returns
  -------
  transformed version of X
docstr_tok: ["Transform","X","and","return","a","transformed","version",".","private","_transform","containing","the","core","logic",",","called","from","transform","Parameters","--","--","--","--","--","X",":","Series","or","Panel","of","mtype","X_inner_mtype","if","X_inner_mtype","is","list",",","_transform","must","support","all","types","in","it","Data","to","be","transformed","y",":","Series","or","Panel",",","default=None","Additional","data",",","e.g.",",","labels","for","transformation","Returns","--","--","--","-","transformed","version","of","X"]
code: def _transform(self, X, y=None):
      """Transform X and return a transformed version.
  
      private _transform containing the core logic, called from transform
  
      Parameters
      ----------
      X : Series or Panel of mtype X_inner_mtype
          if X_inner_mtype is list, _transform must support all types in it
          Data to be transformed
      y : Series or Panel, default=None
          Additional data, e.g., labels for transformation
  
      Returns
      -------
      transformed version of X
      """
      from holidays import financial_holidays
  
      holidays_data = financial_holidays(
          self.market,
          years=self.years,
          expand=self.expand,
          observed=self.observed,
      )
  
      if isinstance(X.index, pandas.DatetimeIndex):
          dates = X.index
      elif isinstance(X.index, pandas.PeriodIndex):
          dates = X.index.to_timestamp()
      else:
          # should be non-reachable
          # enforce_index_type tag is set
          raise TypeError(
              f"{self.__class__.__name__} does not support {type(X.index)}"
          )
  
      # dates.isin(holidays_data) behave surprisingly
      # it fails to detect correctly first time
      # but works correctly while using one at a time
      financial_holidays = [date in holidays_data for date in dates]
  
      return pandas.Series(financial_holidays, name=self._name)
  
imports: import pandas
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 3 for calling the FinancialHolidaysTransformer obj's underlying member method code with example usage: obj._transform(X, y) and returns: pandas