          self._populate()
          app_config = self.app_configs.get(app_label)
          if app_config is None or (only_installed and not app_config.installed):
              raise LookupError("No app with label %r." % app_label)
          if self.available_apps is not None and app_config.label not in self.available_apps:
              raise UnavailableApp("App with label %r isn't available." % app_label)
          return app_config
  
      def get_apps(self):
          """
 
</s> remove                     and app_label not in self.available_apps):
 </s> add                     and app_config.name not in self.available_apps): </s> remove             if self.available_apps is not None and app_config.label not in self.available_apps:
 </s> add             if self.available_apps is not None and app_config.name not in self.available_apps: </s> remove             model_list = [m for m in model_list if m._meta.app_label in self.available_apps]
 </s> add             model_list = [
                m for m in model_list
                if self.app_configs[m._meta.app_label].name in self.available_apps
            ] </s> remove                 model_list = [m for m in model_list if m._meta.app_label in self.available_apps]
 </s> add                 model_list = [
                    m for m in model_list
                    if self.app_configs[m._meta.app_label].name in self.available_apps
                ] </s> remove                 "apps, extra apps: " + ", ".join(extra))
        self.available_apps = set(app.rsplit('.', 1)[-1] for app in available)
 </s> add                 "apps, extra apps: %s" % ", ".join(available - installed))
        self.available_apps = available
        if self.available_apps is not None and app_config.name not in self.available_apps:
          self._populate()
          app_config = self.app_configs.get(app_label)
          if app_config is None or (only_installed and not app_config.installed):
              raise LookupError("No app with label %r." % app_label)
        if self.available_apps is not None and app_config.name not in self.available_apps:
              raise UnavailableApp("App with label %r isn't available." % app_label)
          return app_config
  
      def get_apps(self):
          """
keep keep keep keep replace keep keep keep keep keep
 Simplified handling of available_apps slightly.

It feels more natural for self.available_apps to contain app names (like
INSTALLED_APPS) than app labels, and this is easy to implement now. 
django/apps/cache.py