This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import IPython.core.display as ipydi | |
tabber_template = """<script id="the_tabber">(() => { | |
setTimeout(() => document.querySelector("#the_tabber").closest(".output_area").remove()); | |
document.title="%s"; | |
})()</script>""" | |
def tab(*args): | |
ipydi.display(ipydi.HTML(tabber_template % " ".join(map(str, args)).replace('"','\\"'))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
class DeepDict(defaultdict): | |
def __init__(self, d=None): | |
defaultdict.__init__(self, DeepDict) | |
if d is not None: | |
self.from_dict(d) | |
def __getattr__(self, key): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SettingsMeta(ModelBase): | |
@logged | |
def __getitem__(self, name: str) -> Any: | |
return Setting.get_value(name) | |
@logged | |
def __setitem__(self, name: str, value) -> None: | |
Setting.set_value(name, value) | |