code: def _init_mask(self, mask):
      if isinstance(mask, list) or ivy.is_array(mask):
          ivy.utils.assertions.check_equal(
              ivy.shape(self._data),
              ivy.shape(ivy.array(mask)),
              message="shapes of data and mask must match",
              as_array=False,
          )
          self._mask = ivy.array(mask)
      elif mask.all():
          self._mask = ivy.ones_like(self._data)
      else:
          self._mask = ivy.zeros_like(self._data)
      self._mask = self._mask.astype("bool")
  
imports: import ivy
  import ivy.functional.frontends.numpy
  import numpy
label_desc: Use image node_id 3 for calling the MaskedArray obj's underlying member method code with example usage: obj._init_mask(mask) without return types