code: def test_unwrap_2d_all_masked():
      # Segmentation fault when image is masked array with a all elements masked
      # GitHub issue #1347
      # all elements masked
      image = np.ma.zeros((10, 10))
      image[:] = np.ma.masked
      unwrap = unwrap_phase(image)
      assert_(np.ma.isMaskedArray(unwrap))
      assert_(np.all(unwrap.mask))
  
      # 1 unmasked element, still zero edges
      image = np.ma.zeros((10, 10))
      image[:] = np.ma.masked
      image[0, 0] = 0
      unwrap = unwrap_phase(image)
      assert_(np.ma.isMaskedArray(unwrap))
      assert_(np.sum(unwrap.mask) == 99)  # all but one masked
      assert_(unwrap[0, 0] == 0)
  
file_path: scikit-image/skimage/restoration/tests/test_unwrap.py
imports: import numpy
  from skimage.restoration import unwrap_phase
  import sys
  from skimage._shared import testing
  from skimage._shared.testing import assert_array_almost_equal_nulp, assert_almost_equal, assert_array_equal, assert_, skipif
  from skimage._shared._warnings import expected_warnings
label_desc: Use image node_id 12 for calling a global function with example usage: test_unwrap_2d_all_masked() without return types