def use_color(setting):
if setting not in COLOR_CHOICES:<EOL><INDENT>raise InvalidColorSetting(setting)<EOL><DEDENT>return (<EOL>setting == '<STR_LIT>' or<EOL>(setting == '<STR_LIT>' and sys.stdout.isatty() and terminal_supports_color)<EOL>)<EOL>
Choose whether to use color based on the command argument.

    Args:
        setting - Either `auto`, `always`, or `never`