def indent(s, n_spaces=2, initial=True):
    """
    Indent all new lines
    Args:
        n_spaces: number of spaces to use for indentation
        initial: whether or not to start with an indent
    """
    i = ' '*n_spaces
    t = s.replace('\n', '\n%s' % i)
    if initial:
        t = i + t
    return t