code: def _get_metadata_str(dat, field):
      if field not in np.array(dat.get("nirs/metaDataTags")):
          return None
      data = dat.get(f"/nirs/metaDataTags/{field}")
      data = _correct_shape(np.array(data))
      data = str(data[0], "utf-8")
      return data
  
imports: import datetime
  import re
  import numpy
  from ..._fiff._digitization import _make_dig_points
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _format_dig_points, create_info
  from ..._fiff.utils import _mult_cal_one
  from ..._freesurfer import get_mni_fiducials
  from ...annotations import Annotations
  from ...transforms import _frame_to_str, apply_trans
  from ...utils import _check_fname, _import_h5py, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
  from ..nirx.nirx import _convert_fnirs_to_head
label_desc: Use image node_id 7 for calling a global function with example usage: _get_metadata_str(dat, field) and returns: data, None