def get_language(self, language_code, site_id=None):
        if language_code is None:
            # This happens when using parler in management commands.
            # Use translation.activate('en') if you need to have a default locale active.
            if get_language() is None:
                raise ValueError("language_code can't be null, use translation.activate(..) when accessing translated models outside the request/response loop.")
            else:
                raise ValueError("language_code can't be null")

        if site_id is None:
            site_id = getattr(settings, 'SITE_ID', None)

        for lang_dict in self.get(site_id, ()):
            if lang_dict['code'] == language_code:
                return lang_dict

        # no language match, search for variant: fr-ca falls back to fr
        for lang_dict in self.get(site_id, ()):
            if lang_dict['code'].split('-')[0] == language_code.split('-')[0]:
                return lang_dict

        return self['default']
Convert an image and RoIs within that image into network inputs.
dataset/ETHPy150Open edoburu/django-parler/parler/utils/conf.py/LanguagesSetting.get_language--crossover with--dataset/ETHPy150Open rbgirshick/fast-rcnn/lib/fast_rcnn/test.py/_get_blobs