code: def stack(
      data_arrays: Sequence[xr.DataArray],
      weights: Optional[Sequence[xr.DataArray]] = None,
      combine_times: bool = True,
      blend_type: str = "select_with_weights",
  ) -> xr.DataArray:
      """Combine a series of datasets in different ways.
  
      By default, DataArrays are stacked on top of each other, so the last one
      applied is on top. Each DataArray is assumed to represent the same
      geographic region, meaning they have the same area. If a sequence of
      weights is provided then they must have the same shape as the area.
      Weights with greater than 2 dimensions are not currently supported.
  
      When weights are provided, the DataArrays will be combined according to
      those weights. Data can be integer category products (ex. cloud type),
      single channels (ex. radiance), or a multi-band composite (ex. an RGB or
      RGBA true_color). In the latter case, the weight array is applied
      to each band (R, G, B, A) in the same way. The result will be a composite
      DataArray where each pixel is constructed in a way depending on ``blend_type``.
  
      Blend type can be one of the following:
  
       * select_with_weights: The input pixel with the maximum weight is chosen.
       * blend_with_weights: The final pixel is a weighted average of all valid
         input pixels.
  
      """
      if weights:
          return _stack_with_weights(
              data_arrays, weights, combine_times, blend_type
          )
      return _stack_no_weights(data_arrays, combine_times)
  
file_path: satpy/satpy/multiscene/_blend_funcs.py
imports: from __future__ import annotations
  from datetime import datetime
  from typing import Callable, Iterable, Mapping, Optional, Sequence
  import pandas
  import xarray
  from dask import array
  from satpy.dataset import combine_metadata
label_desc: Use image node_id 1 for calling a global function with example usage: stack(data_arrays, weights, combine_times, blend_type) and returns: _stack_no_weights, _stack_with_weights