'Returns the module containing the models for the given app_label.
Returns None if the app has no models in it and emptyOK is True.
Raises UnavailableApp when set_available_apps() in in effect and
doesn\'t include app_label.'

def get_app(self, app_label, emptyOK=False):

    self._populate()
    imp.acquire_lock()
    try:
        for app_name in settings.INSTALLED_APPS:
            if (app_label == app_name.split('.')[(-1)]):
                mod = self.load_app(app_name, False)
                if ((mod is None) and (not emptyOK)):
                    raise ImproperlyConfigured(('App    with    label    %s    is    missing    a    models.py    module.' % app_label))
                if ((self.available_apps is not None) and (app_label not in self.available_apps)):
                    raise UnavailableApp(("App    with    label    %s    isn't    available." % app_label))
                return mod
        raise ImproperlyConfigured(('App    with    label    %s    could    not    be    found' % app_label))
    finally:
        imp.release_lock()
