Get all the requests for a single variant
341977
def requests_for_variant(self, request, variant_id=None):
        
        requests = ProductRequest.objects.filter(variant__id=variant_id)
        serializer = self.serializer_class(requests, many=True)
        return Response(data=serializer.data, status=status.HTTP_200_OK)
667461
def all(self):
        

        response = self._get_json(HTTPMethods.GET, self.saved_query_url, self._get_master_key())

        return response
608646
def get_merge_requests(self):
        ""
        g = self.gitlab
        merges = self.get(g['url'] + "/projects/" +
                          g['repo'] + "/merge_requests",
                          {'private_token': g['token'],
                           'state': 'all'}, cache=False)
        return dict([(str(merge['id']), merge) for merge in merges])
414941
def _get_pull_requests(self):
        
        for pull in self.repo.pull_requests(
            state="closed", base=self.github_info["master_branch"], direction="asc"
        ):
            if self._include_pull_request(pull):
                yield pull
696824
def do_requests_to_getall(self, uri, requested_count):
        
        items = []

        while uri:
            logger.debug('Making HTTP request to get all resources. Uri: {0}'.format(uri))
            response = self._connection.get(uri)
            members = self.get_members(response)
            items += members

            logger.debug("Response getAll: nextPageUri = {0}, members list length: {1}".format(uri, str(len(members))))
            uri = self.get_next_page(response, items, requested_count)

        logger.debug('Total # of members found = {0}'.format(str(len(items))))
        return items
65093
def iter_variants_by_names(self, names):
        
        for name in names:
            for result in self.get_variant_by_name(name):
                yield result
331093
def _get_request_params(self, **kwargs):
        """"""
        request_params = copy.deepcopy(self._shared_request_params)
        for key, value in iteritems(kwargs):
            if isinstance(value, dict) and key in request_params:
                # ensure we don't lose dict values like headers or cookies
                request_params[key].update(value)
            else:
                request_params[key] = value
        return request_params
11715
def get(self, request, id):
        
        if id:
            return self._get_one(id)
        else:
            return self._get_all()
761416
def variantsGenerator(self, request):
        
        compoundId = datamodel.VariantSetCompoundId \
            .parse(request.variant_set_id)
        dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
        variantSet = dataset.getVariantSet(compoundId.variant_set_id)
        intervalIterator = paging.VariantsIntervalIterator(
            request, variantSet)
        return intervalIterator
862399
def get(self, request, bot_id, format=None):
        
        return super(EnvironmentVarList, self).get(request, bot_id, format)
145305
def requests(self):
        ''''''
        path = pathjoin(self.path, self.name, Request.path)
        response = self.service.send(SRequest('GET', path))
        # a bin behaves as a push-down store --- better to return the requests
        # in order of appearance
        return list(reversed(Request.from_response(response, bin=self)))
1213621
def runSearchVariantAnnotationSets(self, request):
        
        return self.runSearchRequest(
            request, protocol.SearchVariantAnnotationSetsRequest,
            protocol.SearchVariantAnnotationSetsResponse,
            self.variantAnnotationSetsGenerator)
324485
def _get_batch_requests(self, timeout=None):
        """"""
        reqs = []
        s = time()
        while len(reqs) < self.batch_size and (time() - s) < timeout:
            try:
                req = self.queue.get(block=False)
                self.queue.task_done()

                reqs.append(req)
            except Empty as ex:
                if self.stop_flag:
                    break
                else:
                    sleep(0.1)

        if not reqs:
            raise Empty
        elif len(reqs) <= 1:
            return reqs[0]
        else:
            logitems = []
            req = reqs[0]
            for req in reqs:
                logitems.extend(req.get_log_items())

            ret = PutLogsRequest(self.project, self.log_store, req.topic, logitems=logitems)
            ret.__record__ = req.__record__

            return ret
456220
private static List<String> getVariantKeys(String variantKeyPrefix, Collection<String> variants) {

		List<String> variantKeys = new ArrayList<>();
		for (String variant : variants) {
			if (variant == null) {
				variant = "";
			}
			if (variantKeyPrefix == null) {
				variantKeys.add(variant);
			} else {
				variantKeys.add(variantKeyPrefix + variant);
			}
		}

		return variantKeys;
	}
676778
def _all(self, *args, **kwargs):
        '''
        
        '''
        data = dict()
        data['software'] = self._software(**kwargs)
        data['system'] = self._system(**kwargs)
        data['services'] = self._services(**kwargs)
        try:
            data['configuration'] = self._configuration(**kwargs)
        except InspectorQueryException as ex:
            data['configuration'] = 'N/A'
            log.error(ex)
        data['payload'] = self._payload(**kwargs) or 'N/A'

        return data
815212
def list_requests(status=None):
    '''
    
    '''
    if status:
        url = '{0}/request?status={1}'.format(_base_url(), status)
    else:
        url = '{0}/request'.format(_base_url())

    reqs = _paginate(url,
                     "requests",
                     method='GET',
                     decode=True,
                     decode_type='json',
                     raise_error=False,
                     header_dict={
                         'X-DC-DEVKEY': _api_key(),
                         'Content-Type': 'application/json',
                     }
    )

    ret = {'requests': reqs}
    return ret
1071482
def all(self, endpoint, *args, **kwargs):
        
        # 1. Initialize the pagination parameters.
        kwargs.setdefault('params', {})['offset'] = 0
        kwargs.setdefault('params', {})['limit'] = self.limit
        kwargs['__method__'] = 'get'
        # 2. Create an initial paginated request.
        payload = self.request(endpoint, *args, **kwargs)
        has_next = payload.get('result', {}).setdefault(
            'meta', {'next': None}
        )['next']
        # 3. Loop until the end
        while has_next:
            # 4. Increment the offset
            kwargs['params']['offset'] += self.limit
            # 5. Query again
            _payload = self.request(endpoint, *args, **kwargs)
            # 6. Add the paginated data to the global one
            payload['result']['data'].extend(_payload['result']['data'])
            # 7. Compute has_next
            has_next = _payload['result']['meta']['next']
        del payload['result']['meta']
        return payload