@flow.StateHandler(next_state="IterateFind")
  def WriteBuffer(self, responses):

    # Note that hashes must arrive at this state in the correct order since they
    # are sent in the correct order (either via CallState or CallClient).
    index = responses.request_data["index"]
    if index not in self.state.pending_files:
      return

    # Failed to read the file - ignore it.
    if not responses.success:
      return self.RemoveInFlightFile(index)

    response = responses.First()
    file_tracker = self.state.pending_files.get(index)
    if file_tracker:
      file_tracker.fd.AddBlob(response.data, response.length)

      if (response.length < file_tracker.fd.chunksize or
          response.offset + response.length >= file_tracker.size_to_download):
        # File done, remove from the store and close it.
        self.RemoveInFlightFile(index)

        # Close and write the file to the data store.
        file_tracker.fd.Close(sync=True)

        # Publish the new file event to cause the file to be added to the
        # filestore. This is not time critical so do it when we have spare
        # capacity.
        self.Publish("FileStore.AddFileToStore", file_tracker.fd.urn,
                     priority=rdf_flows.GrrMessage.Priority.LOW_PRIORITY)

        self.state.files_fetched += 1

        if not self.state.files_fetched % 100:
          self.Log("Fetched %d of %d files.", self.state.files_fetched,
                   self.state.files_to_fetch)
Return a string fully describing the headers set on this object.
dataset/ETHPy150Open google/grr/grr/lib/flows/general/transfer.py/MultiGetFileMixin.WriteBuffer--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/web/http_headers.py/Headers.__repr__