@staticmethod
    def set(key, val, to_global=False):
        """
        Set a value to specified key in settings

        @param key: a key to set value
        @param val: a value to be set, if provided as not None,
            otherwise key will be deleted instead
        @param to_global: if provided as True, will set the value to
            default settings
        """
        if to_global:
            if val is None:
                if Settings.settings.has(key):
                    Settings.settings.erase(key)
                else:
                    # Return here so it won't wasting time saving old settings
                    return
            else:
                Settings.settings.set(key, val)
            sublime.save_settings(Settings.settings_base)
        else:
            window = sublime.active_window()
            project_data = window.project_data()
            if val is None:
                if (project_data is not None and
                        "terminality" in project_data and
                        key in project_data["terminality"]):
                    del project_data["terminality"][key]
                else:
                    # Return here so it won't wasting time saving old settings
                    return
            else:
                if "terminality" in project_data:
                    data = project_data["terminality"]
                else:
                    data = {}
                data[key] = val
                project_data["terminality"] = data
            window.set_project_data(project_data)
dataset/ETHPy150Open spywhere/Terminality/settings.py/Settings.set/original