def __len__(self) -> int:
        """Get length of the dataset.

        Returns:
            int: Number of clips in the dataset.

        Raises:
            TypeError: If ``self.indexer`` is not an instance of ``ClipsIndexer``.
        """
        if not isinstance(self.indexer, ClipsIndexer):
            msg = "self.indexer must be an instance of ClipsIndexer."
            raise TypeError(msg)
        return self.indexer.num_clips()
Get length of the dataset.

        Returns:
            int: Number of clips in the dataset.

        Raises:
            TypeError: If ``self.indexer`` is not an instance of ``ClipsIndexer``.
        
src/anomalib/data/datasets/base/video.py