swift/proxy/controllers/obj.py
def _have_adequate_responses(
            self, statuses, min_responses, conditional_func):
        """
        Given a list of statuses from several requests, determine if a
        satisfactory number of nodes have responded with 1xx or 2xx statuses to
        deem the transaction for a successful response to the client.

        :param statuses: list of statuses returned so far
        :param min_responses: minimal pass criterion for number of successes
        :param conditional_func: a callable function to check http status code
        :returns: True or False, depending on current number of successes
        """
        if sum(1 for s in statuses if (conditional_func(s))) >= min_responses:
            return True
        return False

        Given a list of statuses from several requests, determine if a
        satisfactory number of nodes have responded with 1xx or 2xx statuses to
        deem the transaction for a successful response to the client.

        :param statuses: list of statuses returned so far
        :param min_responses: minimal pass criterion for number of successes
        :param conditional_func: a callable function to check http status code
        :returns: True or False, depending on current number of successes
        
Given a list of statuses from several requests, determine if a
satisfactory number of nodes have responded with 1xx or 2xx statuses to
deem the transaction for a successful response to the client.
Given a list of statuses from several requests determine if a satisfactory number of nodes have responded with 1xx or 2xx statuses to deem the transaction for a successful response to the client .
def _have_adequate_responses(
            self, statuses, min_responses, conditional_func):
        if sum(1 for s in statuses if (conditional_func(s))) >= min_responses:
            return True
        return False
def _have_adequate_responses ( self , statuses , min_responses , conditional_func ) : if sum ( 1 for s in statuses if ( conditional_func ( s ) ) ) >= min_responses : return True return False
Given a list of statuses from several requests, determine if a
satisfactory number of nodes have responded with 1xx or 2xx statuses to
deem the transaction for a successful response to the client.
Given a list of statuses from several requests determine if a satisfactory number of nodes have responded with 1xx or 2xx statuses to deem the transaction for a successful response to the client .
"""
        Given a list of statuses from several requests, determine if a
        satisfactory number of nodes have responded with 1xx or 2xx statuses to
        deem the transaction for a successful response to the client.

        :param statuses: list of statuses returned so far
        :param min_responses: minimal pass criterion for number of successes
        :param conditional_func: a callable function to check http status code
        :returns: True or False, depending on current number of successes
        """
True or False, depending on current number of successes
True or False depending on current number of successes
self
statuses
list of statuses returned so far
list of statuses returned so far
min_responses
minimal pass criterion for number of successes
minimal pass criterion for number of successes
conditional_func
a callable function to check http status code
a callable function to check http status code