def _indent(code, by=1):
    """Indents every nonempty line of the given code."""
    return "".join(
        ("    " * by if line else "") + line for line in code.splitlines(True)
    )
Indents every nonempty line of the given code.