/*
Check a client response to and determine if it is a snapshot in progress response
to a snapshot request
17895
private boolean isSnapshotInProgressResponse(
            ClientResponse response) {
        if (response.getStatus() != ClientResponse.SUCCESS) {
            return false;
        }

        if (response.getResults() == null) {
            return false;
        }

        if (response.getResults().length < 1) {
            return false;
        }

        VoltTable results = response.getResults()[0];
        if (results.getRowCount() < 1) {
            return false;
        }

        boolean snapshotInProgress = false;
        while (results.advanceRow()) {
            if (results.getString("RESULT").equals("FAILURE")) {
                if (results.getString("ERR_MSG").equals("SNAPSHOT IN PROGRESS")) {
                    snapshotInProgress = true;
                }
            }
        }
        return snapshotInProgress;
    }
458134
function onResponse (res) {
      endTime = getTimeMs(endTime)

      res = Object.assign(res, { opDuration: endTime })

      if (res.error) {
        appendRes = res
      } else {
        log.info(
          {
            res: res,
            duration: endTime
          },
          'end of the request'
        )
      }
    }
11486
function serverResponseToRESPONSE (response) {
	try {
		const obj = JSON.parse(response);
		if (obj.result === RESPONSE_UNKNOWN) {
			return RESPONSE_UNKNOWN;
		} else {
			return obj.result.result;
		}
	} catch (e) {
		return RESPONSE_INVALID;
	}
}
814032
private void checkResponse(ResponseDTO response) throws Throwable {
        if (response == null) {
            throw new RpcException("Response should not be null");
        }

        if (response.getError() != null) {
            throw response.getError().getCause();
        }
    }
653454
private static Boolean checkOwnUpdates(final HttpServletRequest request,
			final ReadResponse response) {
		final String sOwnUpdates = request
				.getParameter(ProtocolConstants.Parameters.Read.OWN_UPDATES);
		if (sOwnUpdates != null) {
			try {
				final int iOwnUpdates = Integer.valueOf(sOwnUpdates);
				return (iOwnUpdates != 0);
			} catch (final NumberFormatException e) {
				response.ownUpdatesInvalid(sOwnUpdates);
			}
		} else {
			response.ownUpdatesMissing();
		}

		return null;
	}
721198
function(src, dest){
      if(fs.existsSync(dest)){
        this.waitForResponse(src, dest); 
      }else{
        this.copy(src, dest); 
        this.triggerNext(); 
      }
    }
543420
function onResponse( repo, idx ) {
		/**
		* FUNCTION: onResponse( error, response, body )
		*	Callback invoked upon receiving a request response.
		*
		* @private
		* @param {Error|Null} error - error object
		* @param {Object} response - HTTP response object
		* @param {String} body - response body
		* @returns {Void}
		*/
		return function onResponse( error, response, body ) {
			if ( eFLG ) {
				return;
			}
			debug( 'Response received for repository `%s` (%d).', repo, idx );
			if ( arguments.length === 1 ) {
				eFLG = true;
				debug( 'Encountered an application-level error for repository `%s` (%d): %s', repo, idx, error.message );
				return clbk( error );
			}
			if ( error ) {
				debug( 'Failed to resolve file for repository `%s` (%d): %s', repo, idx, error.message );
				out.failures[ repo ] = error.message;
				fcount += 1;
			} else {
				debug( 'Successfully resolved file for repository `%s` (%d).', repo, idx );
				out.data[ repo ] = body;
				scount += 1;
			}
			count += 1;
			debug( 'Request %d of %d complete.', count, len );
			next();
		}; // end FUNCTION onResponse()
	}
435175
def is_response(cls, response):
        ''''''
        if response.body:
            if cls.is_file(response.body):
                return True
969716
void userSnapshotRequestExistenceCheck(boolean deleteExistingRequest) throws Exception {
        if (deleteExistingRequest) {
            m_zk.delete(VoltZK.user_snapshot_request, -1, null, null);
        }
        if (m_zk.exists(VoltZK.user_snapshot_request, m_userSnapshotRequestExistenceWatcher) != null) {
            processUserSnapshotRequestEvent(new WatchedEvent(
                    EventType.NodeCreated,
                    KeeperState.SyncConnected,
                    VoltZK.user_snapshot_request));
        }
    }
911121
@SuppressWarnings("unused")
  protected void handleInstallResponseOk(RaftMemberContext member, InstallRequest request, InstallResponse response) {
    // Reset the member failure count and update the member's status if necessary.
    succeedAttempt(member);

    // If the install request was completed successfully, set the member's snapshotIndex and reset
    // the next snapshot index/offset.
    if (request.complete()) {
      member.setNextSnapshotIndex(0);
      member.setNextSnapshotOffset(0);
      member.setSnapshotIndex(request.snapshotIndex());
    }
    // If more install requests remain, increment the member's snapshot offset.
    else {
      member.setNextSnapshotOffset(request.chunkOffset() + 1);
    }

    // Recursively append entries to the member.
    appendEntries(member);
  }
114493
private String getResponseString(boolean async, UploaderResponse response) {
        return async ? response.getTicketId() : response.getPhotoId();
    }
484011
@SuppressWarnings("unused")
  protected void handleInstallResponseOk(MemberState member, InstallRequest request, InstallResponse response) {
    // Reset the member failure count and update the member's status if necessary.
    succeedAttempt(member);

    // If the install request was completed successfully, set the member's snapshotIndex and reset
    // the next snapshot index/offset.
    if (request.complete()) {
      member.setSnapshotIndex(request.index())
        .setNextSnapshotIndex(0)
        .setNextSnapshotOffset(0);
    }
    // If more install requests remain, increment the member's snapshot offset.
    else {
      member.setNextSnapshotOffset(request.offset() + 1);
    }

    // Recursively append entries to the member.
    appendEntries(member);
  }
858316
def _did_receive_response(self, connection):
        

        if connection.has_timeouted:
            bambou_logger.info("NURESTConnection has timeout.")
            return

        has_callbacks = connection.has_callbacks()
        should_post = not has_callbacks

        if connection.handle_response_for_connection(should_post=should_post) and has_callbacks:
            callback = connection.callbacks['local']
            callback(connection)
490271
public void checkResponse(RpcRequest request) throws IOException {
        if (getResponse().getRejectStatus() == RejectStatus.AUTH_ERROR.getValue()) {
            request.setUsePrivilegedPort(true);
        }
        if (getResponse().getState() != NfsStatus.NFS3_OK.getValue()) {
            int responseState = getResponse().getState();
            if (responseState == NfsStatus.NFS3ERR_NOENT.getValue()) {
                throw new FileNotFoundException(request.getErrorMessage());
            }
            NfsStatus status = NfsStatus.fromValue(responseState);
            throw new NfsException(status, request.getErrorMessage() + " error code:" + status.toString());
        }
    }
1285115
def _get_async_status(self, response):
        
        if self._is_empty(response):
            return None
        body = response.json()
        return body.get('status')
565325
private static boolean checkSuccess(HttpResponse response, boolean dryRun, TaskListener listener) {
        StatusLine status = response.getStatusLine();
        String content = "";
        try {
            content = ExtractorUtils.entityToString(response.getEntity());
            ExtractorUtils.validateStringNotBlank(content);
            JSONObject json = JSONObject.fromObject(content);
            String message = json.getString("message");
            if (assertResponseStatus(dryRun, listener, status, message)) {
                listener.getLogger().println(message);
                return true;
            }
        } catch (IOException e) {
            String parsingErrorStr = "Failed parsing distribution response";
            if (StringUtils.isNotBlank(content)) {
                parsingErrorStr = ": " + content;
            }
            e.printStackTrace(listener.error(parsingErrorStr));
        }
        return false;
    }
174477
def _request_status(self):
        
        if self.item_id:
            return True

        response = self.con.get(self.monitor_url)
        if not response:
            return False

        data = response.json()

        self.status = data.get('status', 'inProgress')
        self.completion_percentage = data.get(self._cc('percentageComplete'),
                                              0)
        self.item_id = data.get(self._cc('resourceId'), None)

        return self.item_id is not None