code: def test_on_separate_bands():
      """Test the `on_separate_bands` decorator."""
  
      def func(array, index, gain=2):
          return xr.DataArray(
              np.ones(array.shape, dtype=array.dtype) * index * gain,
              coords=array.coords,
              dims=array.dims,
              attrs=array.attrs,
          )
  
      separate_func = on_separate_bands(func)
      arr = xr.DataArray(
          np.zeros((3, 10, 10)),
          dims=["bands", "y", "x"],
          coords={"bands": ["R", "G", "B"]},
      )
      assert separate_func(arr).shape == arr.shape
      assert all(
          separate_func(arr, gain=1).values[:, 0, 0] == [0, 1, 2]
      )
  
imports: import contextlib
  import os
  from tempfile import NamedTemporaryFile
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.enhancements import create_colormap, on_dask_array, on_separate_bands, using_map_blocks
label_desc: Use image node_id 6 for calling a global function with example usage: test_on_separate_bands() and returns: xr