code: def __check_label_image(label_image):
      """Check the label image for consistent labelling starting from 1."""
      encountered_indices = scipy.unique(label_image)
      expected_indices = scipy.arange(1, label_image.max() + 1)
      if (
          not encountered_indices.size == expected_indices.size
          or not (encountered_indices == expected_indices).all()
      ):
          raise AttributeError(
              "The supplied label image does either not contain any regions or they are not labeled consecutively starting from 1."
          )
  
file_path: medpy/medpy/graphcut/energy_label.py
imports: import math
  import sys
  import scipy.ndimage
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: __check_label_image(label_image) without return types