code: def l2_lef_schema(settings=None):
      """Define schema for LI L2 LEF product."""
      epoch_ts = datetime(2000, 1, 1, 0, 0, 0, 0)
      start_time = datetime.now()
      start_ts = (start_time - epoch_ts).total_seconds()
  
      settings = settings or {}
  
      nobs = settings.get("num_obs", 123)
  
      return {
          "providers": settings.get("providers", {}),
          "variable_path": settings.get("variable_path", "data/"),
          "dimensions": {
              "events": nobs,
              "scalar": 1,
          },
          "variables": {
              "l1b_geolocation_warning": {
                  "format": "i1",
                  "shape": (),  # test explicitly the scalar case
                  "default_data": lambda: 0,
              },
              "l1b_missing_warning": {
                  "format": "i1",
                  "shape": ("scalar",),
                  "default_data": lambda: 0,
              },
              "l1b_radiometric_warning": {
                  "format": "i1",
                  "shape": ("scalar",),
                  "default_data": lambda: 0,
              },
          },
          "sector_variables": {
              "event_id": {
                  "format": "u4",
                  "shape": ("events",),
                  "fill_value": 65535,
                  "long_name": "ID of LI L2 Event",
                  "default_data": lambda: np.arange(1, nobs + 1),
              },
              "group_id": {
                  "format": "u4",
                  "shape": ("events",),
                  "fill_value": 65535,
                  "long_name": "ID of associated LI L2 Group object",
                  "default_data": lambda: np.arange(1, nobs + 1),
              },
              "flash_id": {
                  "format": "u4",
                  "shape": ("events",),
                  "fill_value": 65535,
                  "long_name": "ID of associated LI L2 Flash object",
                  "default_data": lambda: np.arange(1, nobs + 1),
              },
              "detector": {
                  "format": "u4",
                  "shape": ("scalar",),
                  "fill_value": 65535,
                  "long_name": "ID of detector for this group",
                  "default_data": lambda: 1,
              },
              "latitude": {
                  "format": "i2",
                  "shape": ("events",),
                  "fill_value": -32767,
                  "long_name": "Latitude of group",
                  "units": "degrees_north",
                  "standard_name": "latitude",
                  "default_data": lambda: np.linspace(-90, 90, nobs),
              },
              "longitude": {
                  "format": "i2",
                  "shape": ("events",),
                  "fill_value": -32767,
                  "long_name": "Longitude of group",
                  "units": "degrees_east",
                  "standard_name": "longitude",
                  "default_data": lambda: np.linspace(-180, 80, nobs),
              },
              "radiance": {
                  "format": "u2",
                  "shape": ("events",),
                  "long_name": "Radiance of Flash",
                  "standard_name": "radiance",
                  "units": "mW.m-2.sr-1",
                  "default_data": lambda: np.clip(
                      np.round(np.random.normal(500, 100, nobs)),
                      1,
                      2**16 - 1,
                  ),
              },
              "event_filter_qa": {
                  "format": "u1",
                  "shape": ("events",),
                  "long_name": "L2 event pre-filtering quality assurance value",
                  "default_data": lambda: np.random.randint(
                      1, 2**8 - 1, nobs
                  ),
              },
              "epoch_time": {
                  "format": "f8",
                  "shape": ("scalar",),
                  "long_name": "Start time of integration frame",
                  "units": "seconds since 2000-01-01 00:00:00.0",
                  "default_data": lambda: start_ts,
              },
              "time_offset": {
                  "format": "f4",
                  "shape": ("events",),
                  "long_name": "Time offset from epoch time",
                  "units": "seconds",
                  "default_data": lambda: np.random.uniform(
                      1, 2**31 - 1, nobs
                  ),
              },
              "detector_row": {
                  "format": "u2",
                  "shape": ("events",),
                  "long_name": "Detector row position of event pixel",
                  "units": "1",
                  "default_data": lambda: np.random.randint(
                      1, 1000, nobs
                  ),
              },
              "detector_column": {
                  "format": "u2",
                  "shape": ("events",),
                  "long_name": "Detector column position of event pixel",
                  "units": "1",
                  "default_data": lambda: np.random.randint(
                      1, 1000, nobs
                  ),
              },
          },
      }
  
imports: from datetime import datetime
  import numpy
  import xarray
  from satpy.tests.reader_tests.test_netcdf_utils import FakeNetCDF4FileHandler
label_desc: Use image node_id 2 for calling a global function with example usage: l2_lef_schema(settings) and returns: dict