<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def indent_string(string, num_spaces=2):
    '''Add indentation to a string.

    Replaces all new lines in the string with a new line followed by the
    specified number of spaces, and adds the specified number of spaces to the
    start of the string.

    '''
    indent = ' '.ljust(num_spaces)
    return indent + re.sub('\n', '\n' + indent, string)