code: def write_h5_null_string_att(loc_id, name, s):
      """Write a NULL terminated string attribute at loc_id."""
      dt = make_h5_null_string(length=7)
      name = bytes(name.encode("ascii"))
      s = bytes(s.encode("ascii"))
      at = h5py.h5a.create(
          loc_id, name, dt, h5py.h5s.create(h5py.h5s.SCALAR)
      )
      at.write(np.array(s, dtype=f"|S{len(s)+1}"))
  
file_path: satpy/satpy/tests/reader_tests/test_gerb_l2_hr_h5.py
imports: import h5py
  import numpy
  import pytest
  from satpy import Scene
  from satpy.tests.utils import xfail_h5py_unstable_numpy2
label_desc: Use image node_id 2 for calling a global function with example usage: write_h5_null_string_att(loc_id, name, s) without return types