code: def _apply_scales(array, scales, dtype):
      
      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
docs: Apply scales to the array.