code: def _create_mask(mask_arr, vals):
      """Mask specific values in a 1-dimensional numpy array.
  
      Parameters
      -----------
      mask_arr : numpy array
          An array of the pixel_qa or mask raster of interest.
  
      vals : list of numbers (int or float)
          A list of values from mask_arr (the qa layer) used to create
          the mask for the final return array.
  
      Returns
      -----------
      arr : numpy array
          A numpy array populated with 1's where the mask is applied (a Boolean
          True) and a 0 where no masking will be done.
      """
  
      try:
          vals.sort()
      except AttributeError:
          raise AttributeError("Values should be provided as a list")
  
      # For some reason if you don't copy this here, it changes the input
      # qa layer to a boolean in the main environment.
      new_mask_arr = mask_arr.copy()
      unique_vals = np.unique(new_mask_arr).tolist()
  
      if any(num in vals for num in unique_vals):
          temp_mask = np.isin(new_mask_arr, vals)
          new_mask_arr[temp_mask] = 1
          new_mask_arr[~temp_mask] = 0
  
          return new_mask_arr
  
      else:
          raise ValueError(
              "The values provided for the mask do not occur in your mask array."
          )
  
imports: import numpy
  import numpy.ma
label_desc: Use image node_id 1 for calling a global function with example usage: _create_mask(mask_arr, vals) and returns: new_mask_arr