code: def __ProcessResponse(self, response):
          
          if response.status_code not in self._ACCEPTABLE_STATUSES:
              # We distinguish errors that mean we made a mistake in setting
              # up the transfer versus something we should attempt again.
              if response.status_code in (http_client.FORBIDDEN,
                                          http_client.NOT_FOUND):
                  raise exceptions.HttpError.FromResponse(response)
              else:
                  raise exceptions.TransferRetryError(response.content)
          if response.status_code in (http_client.OK,
                                      http_client.PARTIAL_CONTENT):
              try:
                  self.stream.write(six.ensure_binary(response.content))
              except TypeError:
                  self.stream.write(six.ensure_text(response.content))
              self.__progress += response.length
              if response.info and 'content-encoding' in response.info:
                  # TODO(craigcitro): Handle the case where this changes over a
                  # download.
                  self.__encoding = response.info['content-encoding']
          elif response.status_code == http_client.NO_CONTENT:
              # It's important to write something to the stream for the case
              # of a 0-byte download to a file, as otherwise python won't
              # create the file.
              self.stream.write('')
          return response
docs: Process response (by updating self and writing to self.stream).