def load_plugin(retries):
    """Load the plugin's theme schedule and make sure everything is ready."""

    global SETTINGS
    ThemeScheduler.reset_msg_state()
    external_plugins = ["SubNotifyIsReadyCommand", "ThemeTweakerIsReadyCommand"]
    if external_plugins_loaded(external_plugins) or retries == 0:
        log("Loading...")
        settings_file = "ThemeScheduler.sublime-settings"
        settings_path = join(sublime.packages_path(), 'User', settings_file)
        if not exists(settings_path):
            create_settings(settings_path)

        # Init the settings object
        SETTINGS = sublime.load_settings(settings_file)
        SETTINGS.clear_on_change('reload')
        SETTINGS.add_on_change('reload', manage_thread)

        manage_thread()
    else:
        retries_left = retries - 1
        log("Waiting for ThemeTweaker...")
        sublime.set_timeout(lambda: load_plugin(retries_left), 300)
dataset/ETHPy150Open facelessuser/ThemeScheduler/ThemeScheduler.py/load_plugin/original