<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_cookie(header, charset='utf-8', errors='ignore'):
 """Parse a cookie. :param header: the header to be used to parse the cookie. :param charset: the charset for the cookie values. :param errors: the error behavior for the charset decoding. """

    cookie = _ExtendedCookie()
    if header:
        cookie.load(header)
    result = {}

    # decode to unicode and skip broken items.  Our extended morsel
    # and extended cookie will catch CookieErrors and convert them to
    # `None` items which we have to skip here.
    for key, value in cookie.iteritems():
        if value.value is not None:
            result[key] = unquote_header_value(value.value) \
                .decode(charset, errors)

    return result