code: def handleResponse(self, response):
          
          requestId = KafkaCodec.get_response_correlation_id(response)
          # Protect against responses coming back we didn't expect
          tReq = self.requests.pop(requestId, None)
          if tReq is None:
              # This could happen if we've sent it, are waiting on the response
              # when it's cancelled, causing us to remove it from self.requests
              log.warning('Unexpected response with correlationId=%d: %r',
                          requestId, reprlib.repr(response))
          else:
              tReq.d.callback(response)
docs: Handle the response string received by KafkaProtocol.
  
          Ok, we've received the response from the broker. Find the requestId
          in the message, lookup & fire the deferred with the response.