code: def apply_mask(pianoroll, mask):
      """Apply mask to pianoroll.
  
      Args:
        pianoroll: A 3D binary matrix with 2D slices of pianorolls. This is not
            modified.
        mask: A 3D binary matrix with 2D slices of masks, one per each pianoroll.
  
      Returns:
        A 3D binary matrix with masked pianoroll.
  
      Raises:
        MaskUseError: If the shape of pianoroll and mask do not match.
      """
      if pianoroll.shape != mask.shape:
          raise MaskUseError("Shape mismatch in pianoroll and mask.")
      return pianoroll * (1 - mask)
  
file_path: magenta/magenta/models/coconet/lib_mask.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from magenta.models.coconet import lib_util
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: apply_mask(pianoroll, mask) and returns: unknown