code: def _check_shared_metadata(data_arr, expect_area=False):
      assert data_arr.attrs["sensor"] == "modis"
      assert data_arr.attrs["platform_name"] == "EOS-Terra"
      assert "rows_per_scan" in data_arr.attrs
      assert isinstance(data_arr.attrs["rows_per_scan"], int)
      assert data_arr.attrs["reader"] == "modis_l2"
      if expect_area:
          assert data_arr.attrs.get("area") is not None
      else:
          assert "area" not in data_arr.attrs
  
file_path: satpy/satpy/tests/reader_tests/modis_tests/test_modis_l2.py
imports: from __future__ import annotations
  import dask
  import dask.array
  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 _shape_for_resolution
label_desc: Use image node_id 1 for calling a global function with example usage: _check_shared_metadata(data_arr, expect_area) without return types