human
I wrote the below code

    if isinstance(header, dict):
        header = header.get('HTTP_COOKIE', '')
    elif (header is None):
        header = ''
    if isinstance(header, text_type):
        header = header.encode('latin1', 'replace')
    if (cls is None):
        cls = TypeConversionDict
    def _parse_pairs():
        for (key, val) in _cookie_parse_impl(header):
            key = to_unicode(key, charset, errors, allow_none_charset=True)
            val = to_unicode(val, charset, errors, allow_none_charset=True)
            (yield (try_coerce_native(key), val))
    return cls(_parse_pairs())

What's a good function header?

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

def parse_cookie(header, charset='utf-8', errors='replace', cls=None):