human
I wrote the below code

    if (opts is None):
        opts = {}
    if (('output' in opts) and (opts['output'] != 'highstate')):
        out = opts['output']
    if (out == 'text'):
        out = 'txt'
    elif ((out is None) or (out == '')):
        out = 'nested'
    if opts.get('progress', False):
        out = 'progress'
    opts.update(kwargs)
    if ('color' not in opts):
        def is_pipe():
            '\n                                                Check    if    sys.stdout    is    a    pipe    or    not\n                                                '
            try:
                fileno = sys.stdout.fileno()
            except AttributeError:
                fileno = (-1)
            return (not os.isatty(fileno))
        if opts.get('force_color', False):
            opts['color'] = True
        elif (opts.get('no_color', False) or is_pipe() or salt.utils.platform.is_windows()):
            opts['color'] = False
        else:
            opts['color'] = True
    elif opts.get('force_color', False):
        opts['color'] = True
    elif (opts.get('no_color', False) or salt.utils.is_windows()):
        opts['color'] = False
    else:
        pass
    outputters = salt.loader.outputters(opts)
    if (out not in outputters):
        if (out != 'grains'):
            log.error('Invalid    outputter    {0}    specified,    fall    back    to    nested'.format(out))
        return outputters['nested']
    return outputters[out]

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def get_printout(out, opts=None, **kwargs):