code: def _add_variable_to_netcdf_file(nc, var_name, var_info):
      v = nc.createVariable(
          var_name,
          var_info["data"].dtype.str[1:],
          dimensions=var_info["dim_labels"],
          fill_value=var_info.get("fill_value"),
      )
      v[:] = var_info["data"]
      for attr_key, attr_val in var_info["attrs"].items():
          if isinstance(attr_val, (int, float)):
              attr_val = v.dtype.type(attr_val)
          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 8 for calling a global function with example usage: _add_variable_to_netcdf_file(nc, var_name, var_info) without return types