def indent_code(input_string):
    """
    Split code by newline character, and prepend 4 spaces to each line.
    """
    lines = input_string.strip().split('\n')
    output_string = ''
    for line in lines:
        output_string += '    {}\n'.format(line)
    output_string += '\n'
    return output_string
