def indent(block, num_spaces):
    """Indent each row of the given string block with n spaces."""
    indentation = ' ' * num_spaces
    return indentation + ('\n' + indentation).join(block.split('\n'))
