code: def to_scaled_dtype(val):
      """Parse *val* to return a dtype."""
      res = []
      for i in val:
          if i[1].startswith("S"):
              res.append((i[0], i[1]) + i[2:-1])
          else:
              try:
                  res.append((i[0], i[-1].dtype) + i[2:-1])
              except AttributeError:
                  res.append((i[0], type(i[-1])) + i[2:-1])
  
      return np.dtype(res)
  
file_path: satpy/satpy/readers/xmlformat.py
imports: from __future__ import annotations
  import numpy
  from defusedxml.ElementTree import parse
label_desc: Use image node_id 5 for calling a global function with example usage: to_scaled_dtype(val) and returns: np