code: def _create_coarsest_finest_swath_def(shape, extents, name_suffix):
      from pyresample import SwathDefinition
  
      if len(shape) == 1:
          lons_arr = da.linspace(
              extents[0], extents[2], shape[0], dtype=np.float32
          )
          lats_arr = da.linspace(
              extents[1], extents[3], shape[0], dtype=np.float32
          )
      else:
          lons_arr = da.repeat(
              da.linspace(
                  extents[0], extents[2], shape[1], dtype=np.float32
              )[None, :],
              shape[0],
              axis=0,
          )
          lats_arr = da.repeat(
              da.linspace(
                  extents[1], extents[3], shape[0], dtype=np.float32
              )[:, None],
              shape[1],
              axis=1,
          )
      lons_data_arr = xr.DataArray(
          lons_arr, attrs={"name": f"longitude{name_suffix}"}
      )
      lats_data_arr = xr.DataArray(
          lats_arr, attrs={"name": f"latitude1{name_suffix}"}
      )
      return SwathDefinition(lons_data_arr, lats_data_arr)
  
imports: import math
  import numpy
  import pytest
  import xarray
  from dask import array
  from satpy import Scene
  from satpy.dataset.dataid import default_id_keys_config
  from satpy.tests.utils import FAKE_FILEHANDLER_END, FAKE_FILEHANDLER_START, make_cid, make_dataid
label_desc: Use image node_id 3 for calling a global function with example usage: _create_coarsest_finest_swath_def(shape, extents, name_suffix) and returns: SwathDefinition