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 psutil | |
def rss(label): | |
print(label, psutil.Process().memory_info().rss) | |
class Wrapper: | |
def __init__(self, value): | |
self.value = value | |
def __call__(self): |
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
mode = ['png', 'svg', 'pdf', 'pgf'][3] | |
dpi = 100 | |
poem = ''' | |
Farewell sweet earth and northern sky, | |
for ever blest, since here did lie, | |
and here with lissom limbs did run, | |
beneath the moon, beneath the sun, | |
L\xfathien Tin\xfaviel | |
more fair than mortal tongue can tell. |
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 concurrent.futures | |
import multiprocessing | |
import sys | |
import uuid | |
def globalize(func): | |
def result(*args, **kwargs): | |
return func(*args, **kwargs) | |
result.__name__ = result.__qualname__ = uuid.uuid4().hex | |
setattr(sys.modules[result.__module__], result.__name__, result) |
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
Original problem: | |
ab | |
- cd | |
---- | |
ef | |
+ gh | |
---- | |
iii |