code: def _load_and_check_geolocation(
      scene,
      resolution,
      exp_res,
      exp_shape,
      has_res,
      check_callback=_check_shared_metadata,
  ):
      scene.load(["longitude", "latitude"], resolution=resolution)
      lon_id = make_dataid(name="longitude", resolution=exp_res)
      lat_id = make_dataid(name="latitude", resolution=exp_res)
      if has_res:
          lon_arr = scene[lon_id]
          lat_arr = scene[lat_id]
          assert lon_arr.shape == exp_shape
          assert lat_arr.shape == exp_shape
          # compute lon/lat at the same time to avoid wasted computation
          lon_vals, lat_vals = dask.compute(lon_arr, lat_arr)
          assert lon_arr.dtype == lat_arr.dtype
          assert lon_arr.dtype == np.float32
          assert lon_vals.dtype == lon_arr.dtype
          assert lat_vals.dtype == lat_arr.dtype
          np.testing.assert_array_less(lon_vals, 0)
          np.testing.assert_array_less(0, lat_vals)
          check_callback(lon_arr)
          check_callback(lat_arr)
      else:
          pytest.raises(KeyError, scene.__getitem__, lon_id)
          pytest.raises(KeyError, scene.__getitem__, lat_id)
  
file_path: satpy/satpy/tests/reader_tests/modis_tests/test_modis_l1b.py
imports: from __future__ import annotations
  import dask
  import numpy
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from satpy import Scene, available_readers
  from satpy.tests.utils import CustomScheduler, make_dataid
  from ._modis_fixtures import AVAILABLE_1KM_PRODUCT_NAMES, AVAILABLE_HKM_PRODUCT_NAMES, AVAILABLE_QKM_PRODUCT_NAMES, _shape_for_resolution
label_desc: Use image node_id 2 for calling a global function with example usage: _load_and_check_geolocation(scene, resolution, exp_res, exp_shape, has_res, check_callback) without return types