def get_model(app_label, model_name):
    """
    Given an app label and a model name, returns the corresponding model class.
    """
    try:
        return apps.get_model(app_label, model_name)
    except AppRegistryNotReady:
        if apps.apps_ready and not apps.models_ready:
            # If the models module of the considered app has not been loaded yet,
            # we try to import it manually in order to retrieve the model class.
            # This trick is usefull in order to get the model class during the
            # ``apps.populate()`` call and the execution of related methods of AppConfig
            # instances (eg. ``ready``).

            # Firts, the config of the consideration must be retrieved
            app_config = apps.get_app_config(app_label)
            # Then the models module is manually imported
            import_module((app_config.name, MODELS_MODULE_NAME) % '%s.%s')
            # Finally, tries to return the registered model class
            return apps.get_registered_model(app_label, model_name)
        else:
            raise
dataset/ETHPy150Open ellmetha/django-machina/machina/core/db/models.py/get_model/swapped operands of `%`