code: def _add_variable_to_file(h, var_name, var_info):
      v = h.create(var_name, var_info["type"], var_info["data"].shape)
      v[:] = var_info["data"]
      dim_count = 0
      for dimension_name in var_info["attrs"]["dim_labels"]:
          v.dim(dim_count).setname(dimension_name)
          dim_count += 1
      v.setfillvalue(var_info["fill_value"])
      v.scale_factor = var_info["attrs"].get(
          "scale_factor", SCALE_FACTOR
      )
      v.add_offset = var_info["attrs"].get("add_offset", ADD_OFFSET)
      for attr_key, attr_val in var_info["attrs"].items():
          if attr_key == "dim_labels":
              continue
          setattr(v, attr_key, attr_val)
  
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  from typing import Optional
  import numpy
  import pytest
  from pyhdf.SD import SD, SDC
label_desc: Use image node_id 14 for calling a global function with example usage: _add_variable_to_file(h, var_name, var_info) without return types