code: def flash_from_file(self, partition, source_file, source_len=0,
                        info_cb=DEFAULT_MESSAGE_CALLBACK, progress_callback=None,
                        timeout_ms=None):
      
      if source_len == 0:
        # Fall back to stat.
        source_len = os.stat(source_file).st_size
      download_response = self.download(
          source_file, source_len=source_len, info_cb=info_cb,
          progress_callback=progress_callback)
      flash_response = self.flash(partition, info_cb=info_cb,
                                  timeout_ms=timeout_ms)
      return download_response + flash_response
docs: Flashes a partition from the file on disk.
  
      Args:
        partition: Partition name to flash to.
        source_file: Filename to download to the device.
        source_len: Optional length of source_file, uses os.stat if not provided.
        info_cb: See Download.
        progress_callback: See Download.
        timeout_ms: The amount of time to wait on okay after flashing.
  
      Returns:
        Download and flash responses, normally nothing.