<commit_before>from .base import ImageSource
import cv2


class StaticSource(ImageSource):
    def __init__(self, file_name, mask=None):
        super(StaticSource, self).__init__(mask)
        self.file_name = file_name
        self.img = cv2.imread(self.file_name)

    def get_image(self, frame):
        if self.color_conversion_from_bgr is not None:
            img = cv2.cvtColor(self.img, self.color_conversion_from_bgr)
        else:
            img = self.img
        return self.mask_image(img)<commit_msg>assert when image loading fails<commit_after>from .base import ImageSource
import cv2


class StaticSource(ImageSource):
    def __init__(self, file_name, mask=None):
        super(StaticSource, self).__init__(mask)
        self.file_name = file_name
        self.img = cv2.imread(self.file_name)
        assert self.img is not None, 'Can''t load image ' + self.file_name

    def get_image(self, frame):
        if self.color_conversion_from_bgr is not None:
            img = cv2.cvtColor(self.img, self.color_conversion_from_bgr)
        else:
            img = self.img
        return self.mask_image(img)
{'fraction_non_alphanumeric': 0.08888888888888889, 'fraction_numerical': 0.005333333333333333, 'mean_word_length': 2.882758620689655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6161643', 'n_tokens_mistral': 362, 'n_tokens_neox': 350, 'n_words': 80}