code: def _open_for_write(self):
          
          def put_request(body):
              """
  
              :param body:
              """
              ownerid, datasetid = parse_dataset_key(self._dataset_key)
              response = requests.put(
                  "{}/uploads/{}/{}/files/{}".format(
                      self._api_host, ownerid, datasetid, self._file_name),
                  data=body,
                  headers={
                      'User-Agent': self._user_agent,
                      'Authorization': 'Bearer {}'.format(
                          self._config.auth_token)
                  })
              self._response_queue.put(response)
  
          body = iter(self._queue.get, self._sentinel)
          self._thread = Thread(target=put_request, args=(body,))
          self._thread.start()
docs: open the file in write mode