<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_headers(msg):
 """Takes email.message.Message object initialized from unicode string, returns dict with header fields."""

    headers = {}
    for k in msg.keys():
        # decode_header decodes header but does not convert charset, so these
        # may still be bytes, even in Python 3. However, if it's ASCII
        # only (hence unambiguous encoding), the header fields come back
        # as str (unicode) in Python 3.
        (header_txt, charset) = email.header.decode_header(msg[k])[0]
        if charset is not None:
            header_txt = header_txt.decode(charset)
        headers[k] = header_txt
    return headers