def _zip_request_params(self, urls, query_params, data):
        """Massages inputs and returns a list of 3-tuples zipping them up.

        This is all the smarts behind deciding how many requests to issue.
        It's fine for an input to have 0, 1, or a list of values.
        If there are two inputs each with a list of values, the cardinality of those lists much match.

        Args:
            urls - 1 string URL or a list of URLs
            query_params - None, 1 dict, or a list of dicts
            data - None, 1 dict or string, or a list of dicts or strings
        Returns:
            A list of 3-tuples (url, query_param, data)
        Raises:
            InvalidRequestError - if cardinality of lists does not match
        """

        # Everybody gets to be a list
        if not isinstance(urls, list):
            urls = [urls]
        if not isinstance(query_params, list):
            query_params = [query_params]
        if not isinstance(data, list):
            data = [data]

        # Counts must not mismatch
        url_count = len(urls)
        query_param_count = len(query_params)
        data_count = len(data)

        max_count = max(url_count, query_param_count, data_count)

        if (
            max_count > url_count > 1
            or max_count > query_param_count > 1
            or max_count > data_count > 1
        ):
            raise InvalidRequestError(
                'Mismatched parameter count url_count:{0} query_param_count:{1} data_count:{2} max_count:{3}',
                url_count, query_param_count, data_count, max_count,
            )

        # Pad out lists
        if url_count < max_count:
            urls = urls * max_count
        if query_param_count < max_count:
            query_params = query_params * max_count
        if data_count < max_count:
            data = data * max_count

        return list(zip(urls, query_params, data))
def _zip_request_params ( self , urls , query_params , data ) : if not isinstance ( urls , list ) : urls = [ urls ] if not isinstance ( query_params , list ) : query_params = [ query_params ] if not isinstance ( data , list ) : data = [ data ] url_count = len ( urls ) query_param_count = len ( query_params ) data_count = len ( data ) max_count = max ( url_count , query_param_count , data_count ) if ( max_count > url_count > 1 or max_count > query_param_count > 1 or max_count > data_count > 1 ) : raise InvalidRequestError ( 'Mismatched parameter count url_count:{0} query_param_count:{1} data_count:{2} max_count:{3}' , url_count , query_param_count , data_count , max_count , ) if url_count < max_count : urls = urls * max_count if query_param_count < max_count : query_params = query_params * max_count if data_count < max_count : data = data * max_count return list ( zip ( urls , query_params , data ) )
Massages inputs and returns a list of 3-tuples zipping them up.

        This is all the smarts behind deciding how many requests to issue.
        It's fine for an input to have 0, 1, or a list of values.
        If there are two inputs each with a list of values, the cardinality of those lists much match.

        Args:
            urls - 1 string URL or a list of URLs
            query_params - None, 1 dict, or a list of dicts
            data - None, 1 dict or string, or a list of dicts or strings
        Returns:
            A list of 3-tuples (url, query_param, data)
        Raises:
            InvalidRequestError - if cardinality of lists does not match