code: def _apply_scales(array, scales, dtype):
      """Apply scales to the array."""
      new_array = np.empty(array.shape, dtype)
      for i in array.dtype.names:
          try:
              new_array[i] = array[i] * scales[i]
          except TypeError:
              if np.all(scales[i] == 1):
                  new_array[i] = array[i]
              else:
                  raise
      return new_array
  
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 8 for calling a global function with example usage: _apply_scales(array, scales, dtype) and returns: new_array