code: def get_header(message, name):
      
      header = message.get(name)
      log.debug("Getting header {!r}: {!r}".format(name, header))
      if header:
          return decode_header_part(header)
      return six.text_type()
docs: Gets an email.message.Message and a header name and returns
      the mail header decoded with the correct charset.
  
      Args:
          message (email.message.Message): email message object
          name (string): header to get
  
      Returns:
          decoded header