<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def color_text(text, color="none", bcolor="none", effect="none"):
 """ Return a formated text with bash color """

    istty = False
    try:
        istty = sys.stdout.isatty()
    except:
        pass
    if not istty or not COLOR_ON:
        return text
    else:
        if not effect in COLOR_EFFET.keys():
            effect = "none"
        if not color in COLOR_CODE_TEXT.keys():
            color = "none"
        if not bcolor in COLOR_CODE_BG.keys():
            bcolor = "none"

        v_effect = COLOR_EFFET[effect]
        v_color = COLOR_CODE_TEXT[color]
        v_bcolor = COLOR_CODE_BG[bcolor]

        if effect == "none" and color == "none" and bcolor == "none":
            return text
        else:
            return "\033[%d;%d;%dm" % (v_effect, v_color, v_bcolor) + text + COLOR_RESET