Add docstrings to macro.py