def METHOD_NAME(self):
    """This function is called whenever the label app is loaded."""
    # skip loading if plugin registry is not loaded or we run in a background thread
    if not isPluginRegistryLoaded() or not isInMainThread():
        return
    if canAppAccessDatabase(allow_test=False):
        try:
            self.create_labels()  # pragma: no cover
        except (AppRegistryNotReady, OperationalError):
            # Database might not yet be ready
            warnings.warn('Database was not ready for creating labels', stacklevel=2)