code: def get_heading_encoding(response):
      '''Return the document encoding from a HTTP header.
  
      Args:
          response (Response): An instance of :class:`.http.Response`.
  
      Returns:
          ``str``, ``None``: The codec name.
      '''
      encoding = wpull.protocol.http.util.parse_charset(
          response.fields.get('content-type', ''))
  
      if encoding:
          return wpull.string.normalize_codec_name(encoding)
      else:
          return Nonf get_heading_encoding(response):
      '''Return the document encoding from a HTTP header.
  
      Args:
          response (Response): An instance of :class:`.http.Response`.
  
      Returns:
          ``str``, ``None``: The codec name.
      '''
      encoding = wpull.protocol.http.util.parse_charset(
          response.fields.get('content-type', ''))
  
      if encoding:
          return wpull.string.normalize_codec_name(encoding)
      else:
          return None
docs: Return the document encoding from a HTTP header.
  
      Args:
          response (Response): An instance of :class:`.http.Response`.
  
      Returns:
          ``str``, ``None``: The codec name.