def create_terminal_writer(config, *args, **kwargs):
tw = py.io.TerminalWriter(*args, **kwargs)<EOL>if config.option.color == "<STR_LIT:yes>":<EOL><INDENT>tw.hasmarkup = True<EOL><DEDENT>if config.option.color == "<STR_LIT>":<EOL><INDENT>tw.hasmarkup = False<EOL><DEDENT>return tw<EOL>
Create a TerminalWriter instance configured according to the options
    in the config object. Every code which requires a TerminalWriter object
    and has access to a config object should use this function.