Format docstrings in utils/mem.py