code: def _apply_mask(arr, input_mask):
      """Apply a mask to each band in the provided array.
  
      Parameters
      -----------
      arr : numpy array
          The original numpy array in rasterio (band, row, col) order
          that needs a mask applied.
  
      input_mask : numpy array
          A numpy array containing O's and 1's where the 1's indicate where the
          mask is applied.
  
      Returns
      -----------
      numpy array
          The original numpy array with the mask applied to cover up issue
          pixels.
      """
  
      # Test if input_mask is numpy array w values == 1 for masked
      if not np.any(input_mask == 1):
          raise ValueError(
              "Mask requires values of 1 (True) to be applied."
          )
  
      cover_mask = np.broadcast_to(input_mask == 1, arr.shape)
  
      # If the user provides a masked array, combine masks
      if isinstance(arr, np.ma.MaskedArray):
          cover_mask = np.logical_or(arr.mask, cover_mask)
  
      # Return combined mask
      return ma.masked_array(arr, mask=cover_mask)
  
imports: import numpy
  import numpy.ma
label_desc: Use image node_id 2 for calling a global function with example usage: _apply_mask(arr, input_mask) and returns: ma