<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def use_color(setting):
 """Choose whether to use color based on the command argument. Args: setting - Either `auto`, `always`, or `never` """

    if setting not in COLOR_CHOICES:
        raise InvalidColorSetting(setting)

    return (
        setting == 'always' or
        (setting == 'auto' and sys.stdout.isatty() and terminal_supports_color)
    )