def get_cache(self, instance, translation=None,
                  language=None, field_name=None,
                  field_value=None):
        """
        Returns translation from cache.
        """
        is_new = bool(instance.pk is None)

        try:
            cached_obj = instance._linguist_translations[field_name][language]
            if not cached_obj.field_name:
                cached_obj.field_name = field_name
            if not cached_obj.language:
                cached_obj.language = language
            if not cached_obj.identifier:
                cached_obj.identifier = self.instance.linguist_identifier
        except __HOLE__:
            cached_obj = None

            if not is_new:
                if translation is None:
                    try:
                        translation = self.decider.objects.get(identifier=self.instance.linguist_identifier,
                                                               object_id=self.instance.pk,
                                                               language=language,
                                                               field_name=field_name)
                    except self.decider.DoesNotExist:
                        pass

            if cached_obj is None:
                if translation is not None:
                    cached_obj = CachedTranslation.from_object(translation)
                else:
                    cached_obj = CachedTranslation(instance=instance,
                                                   language=language,
                                                   field_name=field_name,
                                                   field_value=field_value)

            instance._linguist_translations[cached_obj.field_name][cached_obj.language] = cached_obj

        return cached_obj
dataset/ETHPy150Open ulule/django-linguist/linguist/fields.py/Linguist.get_cache