code: def _add_variable_to_hdf4_file(h, var_name, var_info):
      v = h.create(var_name, var_info["type"], var_info["data"].shape)
      v[:] = var_info["data"]
      for dim_count, dimension_name in enumerate(
          var_info["dim_labels"]
      ):
          v.dim(dim_count).setname(dimension_name)
      if var_info.get("fill_value"):
          v.setfillvalue(var_info["fill_value"])
      for attr_key, attr_val in var_info["attrs"].items():
          setattr(v, attr_key, attr_val)
  
file_path: satpy/satpy/tests/reader_tests/test_seadas_l2.py
imports: import numpy
  import pytest
  from pyresample.geometry import SwathDefinition
  from pytest_lazyfixture import lazy_fixture
  from satpy import Scene, available_readers
label_desc: Use image node_id 5 for calling a global function with example usage: _add_variable_to_hdf4_file(h, var_name, var_info) without return types