parameters: (self, data, decode_content, flush_decoder)
return_statement: return data
docstring: Decode the data passed in and potentially flush the decoder.
docstring_summary: Decode the data passed in and potentially flush the decoder.
docstring_tokens: Decode the data passed in and potentially flush the decoder .
function: def _decode(self, data, decode_content, flush_decoder):
          """
          Decode the data passed in and potentially flush the decoder.
          """
          try:
              if decode_content and self._decoder:
                  data = self._decoder.decompress(data)
          except (IOError, zlib.error) as e:
              content_encoding = self.headers.get('content-encoding', '').lower()
              raise DecodeError(
                  "Received response with content-encoding: %s, but "
                  "failed to decode it." % content_encoding, e)
  
          if flush_decoder and decode_content and self._decoder:
              buf = self._decoder.decompress(binary_type())
              data += buf + self._decoder.flush()
  
          return data
function_tokens: def _decode ( self , data , decode_content , flush_decoder ) : try : if decode_content and self . _decoder : data = self . _decoder . decompress ( data ) except ( IOError , zlib . error ) as e : content_encoding = self . headers . get ( 'content-encoding' , '' ) . lower ( ) raise DecodeError ( "Received response with content-encoding: %s, but " "failed to decode it." % content_encoding , e ) if flush_decoder and decode_content and self . _decoder : buf = self . _decoder . decompress ( binary_type ( ) ) data += buf + self . _decoder . flush ( ) return data