def get_mask(self, idx: int) -> torch.Tensor | None:
        """Retrieve the masks from the file system.

        Args:
            idx (int): Index of the clip.

        Returns:
            torch.Tensor | None: Ground truth mask if available, else None.
        """
        video_idx, frames_idx = self.get_clip_location(idx)
        mask_file = self.mask_paths[video_idx]
        if mask_file == "":  # no gt masks available for this clip
            return None
        frames = self.clips[video_idx][frames_idx]

        vid_masks = np.load(mask_file)
        return torch.tensor(np.take(vid_masks, frames, 0))
Retrieve the masks from the file system.

        Args:
            idx (int): Index of the clip.

        Returns:
            torch.Tensor | None: Ground truth mask if available, else None.
        
src/anomalib/data/datasets/video/shanghaitech.py