code: def test_stack():
      img = tf.stack(img1, img2)
      out = np.array(
          [[0xFF00FFFF, 0x00000000], [0x00000000, 0xFF3DBFBC]],
          dtype="uint32",
      )
      assert (img.x_axis == img1.x_axis).all()
      assert (img.y_axis == img1.y_axis).all()
      np.testing.assert_equal(img.data, out)
  
      img = tf.stack(img2, img1)
      out = np.array(
          [[0xFF00FFFF, 0x00000000], [0x00000000, 0xFF00FF7D]],
          dtype="uint32",
      )
      assert (img.x_axis == img1.x_axis).all()
      assert (img.y_axis == img1.y_axis).all()
      np.testing.assert_equal(img.data, out)
  
      img = tf.stack(img1, img2, how="add")
      out = np.array(
          [[0xFF00FFFF, 0x00000000], [0x00000000, 0xFF3DFFFA]],
          dtype="uint32",
      )
      assert (img.x_axis == img1.x_axis).all()
      assert (img.y_axis == img1.y_axis).all()
      np.testing.assert_equal(img.data, out)
  
imports: from __future__ import annotations
  from io import BytesIO
  import numpy
  import xarray
  import dask.array
  import PIL
  import pytest
  import datashader.transfer_functions
  from datashader.tests.test_pandas import assert_eq_ndarray, assert_eq_xr, assert_image_close
label_desc: Use image node_id 20 for calling a global function with example usage: test_stack() without return types