docstr: Adds back components previously removed by `component_mask` in `apply_component_mask` method.
  
  Parameters
  ----------
  series
      input TimeSeries that was fed into transformer.
  vals:
      `np.ndarray` or `TimeSeries` to 'unmask'
  component_mask
      Optionally, np.ndarray boolean mask of shape (n_components, 1) specifying which components were extracted
      from `series`. If given, insert `vals` back into the columns of the original array. If not specified,
      nothing is 'unmasked'.
  
  Returns
  -------
  unmasked
      `TimeSeries` (if `vals` is a `TimeSeries`) or `np.ndarray` (if `vals` is an `np.ndarray`) with those
      components previously removed by `component_mask` now 'added back'.
docstr_tok: ["Adds","back","components","previously","removed","by","`","component_mask","`","in","`","apply_component_mask","`","method",".","Parameters","--","--","--","--","--","series","input","TimeSeries","that","was","fed","into","transformer",".","vals",":","`","np.ndarray","`","or","`","TimeSeries","`","to","'unmask'","component_mask","Optionally",",","np.ndarray","boolean","mask","of","shape","(","n_components",",","1",")","specifying","which","components","were","extracted","from","`","series","`",".","If","given",",","insert","`","vals","`","back","into","the","columns","of","the","original","array",".","If","not","specified",",","nothing","is","'unmasked","'",".","Returns","--","--","--","-","unmasked","`","TimeSeries","`","(","if","`","vals","`","is","a","`","TimeSeries","`",")","or","`","np.ndarray","`","(","if","`","vals","`","is","an","`","np.ndarray","`",")","with","those","components","previously","removed","by","`","component_mask","`","now","'added","back","'","."]
code: def unapply_component_mask(
      series: TimeSeries,
      vals: Union[np.ndarray, TimeSeries],
      component_mask: Optional[np.ndarray] = None,
  ) -> Union[np.ndarray, TimeSeries]:
      """
      Adds back components previously removed by `component_mask` in `apply_component_mask` method.
  
      Parameters
      ----------
      series
          input TimeSeries that was fed into transformer.
      vals:
          `np.ndarray` or `TimeSeries` to 'unmask'
      component_mask
          Optionally, np.ndarray boolean mask of shape (n_components, 1) specifying which components were extracted
          from `series`. If given, insert `vals` back into the columns of the original array. If not specified,
          nothing is 'unmasked'.
  
      Returns
      -------
      unmasked
          `TimeSeries` (if `vals` is a `TimeSeries`) or `np.ndarray` (if `vals` is an `np.ndarray`) with those
          components previously removed by `component_mask` now 'added back'.
      """
  
      if component_mask is None:
          unmasked = vals
      else:
          raise_if_not(
              isinstance(component_mask, np.ndarray)
              and component_mask.dtype == bool,
              "If `component_mask` is given, must be a boolean np.ndarray`",
              logger,
          )
          raise_if_not(
              series.width == len(component_mask),
              "mismatch between number of components in `series` and length of `component_mask`",
              logger,
          )
          unmasked = series.all_values()
          if isinstance(vals, TimeSeries):
              unmasked[:, component_mask, :] = vals.all_values()
              # Remove timepoints not present in transformed data:
              unmasked = series.slice_intersect(vals).with_values(
                  unmasked
              )
          else:
              unmasked[:, component_mask, :] = vals
      return unmasked
  
imports: from abc import ABC, abstractmethod
  from typing import Any, Generator, List, Mapping, Optional, Sequence, Union
  import numpy
  import xarray
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not
  from darts.utils import _build_tqdm_iterator, _parallel_apply
label_desc: Use image node_id 9 for calling the BaseDataTransformer obj's underlying member method code with example usage: obj.unapply_component_mask(series, vals, component_mask) and returns: unmasked