(pianoroll, mask)
return pianoroll * (1 - 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.
Apply mask to pianoroll.
Apply mask to pianoroll .
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)
def apply_mask ( pianoroll , mask ) : if pianoroll . shape != mask . shape : raise MaskUseError ( "Shape mismatch in pianoroll and mask." ) return pianoroll * ( 1 - mask )