def print_diff(diff, color=True):
import colorama<EOL>if not diff:<EOL><INDENT>return<EOL><DEDENT>if not color:<EOL><INDENT>colorama.init = lambda autoreset: None<EOL>colorama.Fore.RED = '<STR_LIT>'<EOL>colorama.Back.RED = '<STR_LIT>'<EOL>colorama.Fore.GREEN = '<STR_LIT>'<EOL>colorama.deinit = lambda: None<EOL><DEDENT>colorama.init(autoreset=True)  <EOL>for line in diff.splitlines():<EOL><INDENT>if line.startswith('<STR_LIT:+>') and not line.startswith('<STR_LIT>'):<EOL><INDENT>print(colorama.Fore.GREEN + line)<EOL><DEDENT>elif line.startswith('<STR_LIT:->') and not line.startswith('<STR_LIT>'):<EOL><INDENT>split_whitespace = re.split('<STR_LIT>', line)<EOL>if len(split_whitespace) > <NUM_LIT:1>:  <EOL><INDENT>line, trailing, _ = split_whitespace<EOL><DEDENT>else:<EOL><INDENT>line, trailing = split_whitespace[<NUM_LIT:0>], '<STR_LIT>'<EOL><DEDENT>print(colorama.Fore.RED + line, end='<STR_LIT>')<EOL>print(colorama.Back.RED + trailing)<EOL><DEDENT>elif line == '<STR_LIT>':<EOL><INDENT>print(colorama.Fore.RED + line)<EOL><DEDENT>else:<EOL><INDENT>print(line)<EOL><DEDENT><DEDENT>colorama.deinit()<EOL>
Pretty printing for a diff, if color then we use a simple color scheme
    (red for removed lines, green for added lines).