def is_mask_anomalous(path: str) -> int:
    """Check if a mask shows defects.

    Args:
        path (str): Path to the mask file.

    Returns:
        int: ``1`` if the mask shows defects, ``0`` otherwise.

    Example:
        >>> from anomalib.data.datasets.image.kolektor import is_mask_anomalous
        >>> path = './datasets/kolektor/kos01/Part0_label.bmp'
        >>> is_mask_anomalous(path)
        1
    """
    img_arr = imread(path)
    if np.all(img_arr == 0):
        return 0
    return 1
Check if a mask shows defects.

    Args:
        path (str): Path to the mask file.

    Returns:
        int: ``1`` if the mask shows defects, ``0`` otherwise.

    Example:
        >>> from anomalib.data.datasets.image.kolektor import is_mask_anomalous
        >>> path = './datasets/kolektor/kos01/Part0_label.bmp'
        >>> is_mask_anomalous(path)
        1
    
src/anomalib/data/datasets/image/kolektor.py