<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_known_codes(s, unique=True, rgb_mode=False):
 """ Find and print all known escape codes in a string, using get_known_codes. """

    total = 0
    for codedesc in get_known_codes(s, unique=unique, rgb_mode=rgb_mode):
        total += 1
        print(codedesc)
    plural = 'code' if total == 1 else 'codes'
    codetype = ' unique' if unique else ''
    print('\nFound {}{} escape {}.'.format(total, codetype, plural))
    return 0 if total > 0 else 1