code: def test_nwcsaf_comps(fake_area, tmp_path, data):
      """Test loading NWCSAF composites."""
      from satpy import Scene
      from satpy.writers import get_enhanced_image
  
      (
          flavour,
          dvname,
          altname,
          palettename,
          statusname,
          comp,
          filelabel,
          dtp,
      ) = _nwcsaf_geo_props[data]
      rng = (0, 100) if dtp == "uint8" else (-100, 1000)
      if flavour == "geo":
          fn = f"S_NWC_{filelabel:s}_MSG2_MSG-N-VISIR_20220124T094500Z.nc"
          reader = "nwcsaf-geo"
          id_ = {"satellite_identifier": "MSG4"}
      else:
          fn = f"S_NWC_{filelabel:s}_noaa20_00000_20230301T1200213Z_20230301T1201458Z.nc"
          reader = "nwcsaf-pps_nc"
          id_ = {"platform": "NOAA-20"}
      fk = tmp_path / fn
      # create a minimally fake netCDF file, otherwise satpy won't load the
      # composite
      ds = xr.Dataset(
          coords={"nx": [0], "ny": [0]},
          attrs={
              "source": "satpy unit test",
              "time_coverage_start": "0001-01-01T00:00:00Z",
              "time_coverage_end": "0001-01-01T01:00:00Z",
          },
      )
      ds.attrs.update(id_)
      ds.to_netcdf(fk)
      sc = Scene(filenames=[os.fspath(fk)], reader=[reader])
      sc[palettename] = xr.DataArray(
          da.tile(da.arange(256), [3, 1]).T,
          dims=("pal02_colors", "pal_RGB"),
      )
      fake_alti = da.linspace(
          rng[0], rng[1], 4, chunks=2, dtype=dtp
      ).reshape(2, 2)
      ancvars = [sc[palettename]]
      if statusname is not None:
          sc[statusname] = xr.DataArray(
              da.zeros(shape=(2, 2), dtype="uint8"),
              attrs={"area": fake_area, "_FillValue": 123},
              dims=("y", "x"),
          )
          ancvars.append(sc[statusname])
      sc[dvname] = xr.DataArray(
          fake_alti,
          dims=("y", "x"),
          attrs={
              "area": fake_area,
              "scaled_FillValue": 123,
              "ancillary_variables": ancvars,
              "valid_range": rng,
          },
      )
  
      def _fake_get_varname(info, info_type="file_key"):
          return altname or dvname
  
      with mock.patch(
          "satpy.readers.nwcsaf_nc.NcNWCSAF._get_varname_in_file"
      ) as srnN_:
          srnN_.side_effect = _fake_get_varname
          sc.load([comp])
      im = get_enhanced_image(sc[comp])
      if flavour == "geo":
          assert im.mode == "P"
          np.testing.assert_array_equal(im.data.coords["bands"], ["P"])
          if dtp == "float64":
              np.testing.assert_allclose(
                  im.data.sel(bands="P"),
                  ((fake_alti - rng[0]) * (255 / np.ptp(rng))).round(),
              )
          else:
              np.testing.assert_allclose(
                  im.data.sel(bands="P"), fake_alti
              )
  
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 10 for calling a global function with example usage: test_nwcsaf_comps(fake_area, tmp_path, data) and returns: unknown