def load_model(app_label, model, orm=None, required=True):
    """
    Load the specified model class, or the class it was swapped out for.
    If a South orm object is provided, it will be used (but only if the
    model hasn't been swapped.)
    """
    swapped = is_swapped(app_label, model)
    if swapped:
        app_label, model = split(swapped)
    else:
        if orm is not None:
            return orm[join(app_label, model)]

    try:
        try:
            # django >= 1.7
            from django.apps import apps
            cls = apps.get_model(app_label, model)
        except ImportError:
            # django < 1.7
            from django.db.models import get_model
            cls = get_model(app_label, model)
    except LookupError:
        # both get_model versions can raise a LookupError
        cls = None

    if cls is None and required:
        raise ImproperlyConfigured(
            "Could not find {name}!".format(name=join(app_label, model))
        )
    return cls
Load the specified model class, or the class it was swapped out for.
    If a South orm object is provided, it will be used (but only if the
    model hasn't been swapped.)