def METHOD_NAME(self, data, languages=None):
    if not self.MIN_SIZE < len(data) < self.MAX_SIZE:
        log.info("OCR: file size out of range (%d)", len(data))
        return None
    languages = sorted(set(languages or []))
    data_key = sha1(data).hexdigest()
    key = self.cache_key("ocr", data_key, *languages)
    text = self.tags.get(key)
    if text is not None:
        log.info("OCR: %s chars cached", len(text))
        return stringify(text)
    if not hasattr(settings, "_ocr_service"):
        if settings.OCR_VISION_API:
            settings._ocr_service = GoogleOCRService()
        else:
            settings._ocr_service = LocalOCRService()
    text = settings._ocr_service.extract_text(data, languages=languages)
    if text is not None:
        self.tags.set(key, text)
        log.info("OCR: %s chars (from %s bytes)", len(text), len(data))
    return stringify(text)