def cb(): mem = get_mem() source.data.update({"gpu": mem}) fig.title.text = "GPU Memory: {}".format(format_bytes(sum(mem)))
def test_format_bytes(): from jupyterlab_nvdashboard.utils import format_bytes assert format_bytes(1e13) == "10.00 TB"