def add_on_change(key, callback):
    """
    Sets the callback to run when the given settings key changes.
    :type key: str
    :type callback: () -> None
    """
    if _settings is None:
        add_on_change_callbacks[key].add(callback)
    else:
        _settings.add_on_change(key, callback)
dataset/ETHPy150Open Varriount/NimLime/nimlime_core/settings.py/add_on_change/original