What is this?
The tools I find myself copying and pasting between every python project.
How do I use this?
pip install blissful_basics
from blissful_basics import print, flatten, to_pure, stringify, stats, product, countdown, large_pickle_save, large_pickle_load, FS, Object
if 1:
print.indent.string = " "
@print.indent.function
def my_func(counter=5):
if counter <= 0: return
print(f"function call {counter} start")
my_func(counter-1)
print(f"function call {counter} done")
my_func()
with print.indent:
print("howdy1")
with print.indent:
print("howdy2")
print("howdy3")
with print.indent.block("stuff"):
print("hi")
my_func()
if 1:
import numpy
import torch
to_pure(numpy.array([1,2,3,4,5]))
to_pure(torch.tensor([1,2,3,4,5]))
if 1:
stats([1,2,3,4,5])
if 1:
a = Object(thing=10)
a.thing
a.thing = 99
a.thing