human
Complete the below
def format_colors(text):

    ''''Inserts *nix colour sequences into a string.
    Parses a string, and replaces colour tags ([color xxx]xxx[/color]) with
    the appropriate control sequence.'
    '''
assistant
#Here is the Python program you requested.
    def replace_color(m):
        '\n                                Callback    function,    to    replace    a    colour    tag    with    its    content    and    a\n                                suitable    escape    sequence    to    change    colour.\n                                '
        return ('%s%s%s' % (Colors[m.group(1)], m.group(2), Colors['end']))
    text = re.sub('\\[color\\s*([a-z]+)\\](.*?)\\[\\/color\\]', replace_color, text)
    return text