Send a request for latest auction info, return the response.
979287
def auction(self, symbol='btcusd'):
        """"""
        url = self.base_url + '/v1/auction/' + symbol

        return requests.get(url)
1050769
def request(self, id, **kwargs):
        
        data = self.get('requests', id, **kwargs)
        return data
930183
def update(self, request, *args, **kwargs):
        
        return super(PriceListItemViewSet, self).update(request, *args, **kwargs)
423607
def _request_api(self, **kwargs):
        
        _url = kwargs.get('url')
        _method = kwargs.get('method', 'GET')
        _status = kwargs.get('status', 200)

        counter = 0
        if _method not in ['GET', 'POST']:
            raise ValueError('Method is not GET or POST')

        while True:
            try:
                res = REQ[_method](_url, cookies=self._cookie)
                if res.status_code == _status:
                    break
                else:
                    raise BadStatusException(res.content)
            except requests.exceptions.BaseHTTPError:
                if counter < self._retries:
                    counter += 1
                    continue
                raise MaxRetryError
        self._last_result = res
        return res
129623
def request_time(self, req):
        """"""
        r = time.time()
        self._time_result.set_value(r)
        return ("ok", r)
650185
def _request(self, url, params=None, timeout=10):
        """"""
        rsp = self._session.get(url, params=params, timeout=timeout)
        rsp.raise_for_status()
        return rsp.text.strip()
497065
def _query(self, ResponseGroup="Large", **kwargs):
        
        response = self.api.ItemSearch(ResponseGroup=ResponseGroup, **kwargs)
        root = objectify.fromstring(response)
        if (hasattr(root.Items.Request, 'Errors') and
                not hasattr(root.Items, 'Item')):
            code = root.Items.Request.Errors.Error.Code
            msg = root.Items.Request.Errors.Error.Message
            if code == 'AWS.ParameterOutOfRange':
                raise NoMorePages(msg)
            elif code == 'HTTP Error 503':
                raise RequestThrottled(
                    "Request Throttled Error: '{0}', '{1}'".format(code, msg))
            else:
                raise SearchException(
                    "Amazon Search Error: '{0}', '{1}'".format(code, msg))
        if hasattr(root.Items, 'TotalPages'):
            if root.Items.TotalPages == self.current_page:
                self.is_last_page = True
        return root
1350646
def execute_query(self, payload):
        ''''''
        if vars(self).get('oauth'):
            if not self.oauth.token_is_valid(): # Refresh token if token has expired
                self.oauth.refresh_token()
            response = self.oauth.session.get(self.PRIVATE_URL, params= payload, header_auth=True)
        else:
            response = requests.get(self.PUBLIC_URL, params= payload)

        self._response = response # Saving last response object.
        return response
1291168
def items_get(self, **kwargs):
        ''''''
        request = TOPRequest('taobao.increment.items.get')
        for k, v in kwargs.iteritems():
            if k not in ('status', 'nick', 'start_modified', 'end_modified', 'page_no', 'page_size') and v==None: continue
            request[k] = v
        self.create(self.execute(request), fields=['notify_items', 'total_results'], models={'notify_items':NotifyItem})
        return self.notify_items
1175814
def get_response(self, key, serializable=False):
        """"""
        range_request = self._build_get_range_request(
            key,
            serializable=serializable
        )

        return self.kvstub.Range(
            range_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
854160
public function postBid(Request $request)
    {
        $item = Item::findOrFail($request->input('item_id'));

        if ($item->seller->userId == Auth::user()->userId) {
            return redirect()->back()->withErrors([
                'You cannot bid on your own items.',
            ]);
        }

        if (time() < $item->startDate) {
            return redirect()->back()->withErrors([
                'This item is not yet open for bidding.',
            ]);
        }

        if (time() > $item->endDate) {
            return redirect()->back()->withErrors([
                'This item has ended and cannot be bid on.',
            ]);
        }

        $minimum_bid = ($item->bids->count())
            ? BidIncrement::getMinimumNextBid($item->biddingPrice)
            : $item->startPrice;

        $highest_bid = $item->getBidHistory()->first();

        // If highest bidder, new bid must be higher than existing maximum
        if ($highest_bid && $highest_bid->bidder == Auth::user()) {
            if ($request->input('amount') < BidIncrement::getMinimumNextBid($highest_bid->amount)) {
                return redirect()->back()->withErrors([
                    'amount' => 'Your new maximum bid does not meet the minimum amount.',
                ]);
            }
        // Not highest bidder, so bid must be higher than minimum amount for current bidding price
        } elseif ($request->input('amount') < $minimum_bid) {
            return redirect()->back()->withErrors([
                'amount' => 'Your bid does not meet the minimum amount.',
            ]);
        }

        $this->validate(
            $request,
            [
                'amount' => 'required|monetary',
            ]
        );

        $item->placeBid($request->input('amount'), Auth::user());

        // If there's no highest bid, there's no bids, so bidding price can stay at start price
        if ($highest_bid) {
            // Have we beaten the highest bid?
            if ($request->input('amount') > $highest_bid->amount) {
                // If the reserve price is above the last highest bid but below the new maximum bid, set bidding to that
                if ($item->isReserved() && $request->input('amount') >= $item->reservePrice) {
                    $item->biddingPrice = $item->reservePrice;
                }

                // Check if we're increasing the maximum bid
                if ($highest_bid->bidder == Auth::user()) {
                    // Save in case the bidding price has been bumped to the reserve
                    $item->save();

                    $highest_bid->delete();

                    return redirect()->back()->withStatus('Your maximum bid has been increased.');
                }

                // Make sure we're not using the reserve price as the new bidding price
                if (!in_array('bidding_price', array_keys($item->getDirty()))) {
                    // Set bidding to the maximum bid or the next increment, whichever is lower
                    $item->biddingPrice = min([
                        $request->input('amount'),
                        // Calculate the next increment after the previous highest bid
                        $item::getMinimumBidAmount($highest_bid->amount),
                    ]);
                }

                $highest_bid->bidder->sendEmail(
                    "You've been outbid",
                    'emails.item.outbid',
                    [
                        'item_id'    => $item->itemId,
                        'item_name'  => $item->name,
                        'item_price' => $item->biddingPrice,
                    ]
                );
            // We're not the highest bid, so just increment
            } else {
                $item->biddingPrice = $request->input('amount');
            }
        } else {
            $item->biddingPrice = ($item->isReserved() && $request->input('amount') >= $item->reservePrice)
                ? $item->reservePrice
                : $item->startPrice;
        }

        $item->save();

        return redirect()->back()->withStatus('Your bid has been placed.');
    }
1079100
function sendResponse (err, resources) {
    // Extract the "data" of each Resource
    resources = _.map(resources, "data");

    // Use the current date/time as the "last-modified" header
    res.swagger.lastModified = new Date();

    // Set the response body (unless it's already been set by other middleware)
    if (err || res.body) {
      next(err);
    }
    else if (!res.swagger.isCollection) {
      // Response body is a single value, so only return the first item in the collection
      res.body = _.first(resources);
      next();
    }
    else {
      // Response body is the resource that was created/update/deleted
      res.body = resources;
      next();
    }
  }
227303
def recent(self, include=None):
        
        return self._query_zendesk(self.endpoint.recent, 'ticket', id=None, include=include)
1073713
def send_request(self, request):
        
        if request.observe == 0:
            # Observe request
            host, port = request.destination
            key_token = hash(str(host) + str(port) + str(request.token))

            self._relations[key_token] = ObserveItem(time.time(), None, True, None)

        return request
212614
def get(self, request, bot_id, id, format=None):
                
        return super(StateDetail, self).get(request, bot_id, id, format)
80637
function (bidRequests, bidderRequest) {
    const topLocation = utils.getTopWindowLocation();
    const payload = {
      id: bidRequests[0].auctionId,
      site: {
        domain: window.location.protocol + '//' + topLocation.hostname,
        name: topLocation.hostname,
        page: topLocation.href,
      },
      device: {
        ua: navigator.userAgent,
        language: navigator.language,
        devicetype: isMobile() ? 1 : isConnectedTV() ? 3 : 2,
      },
      imp: bidRequests.map(mapImpression)
    };

    if (bidderRequest && bidderRequest.gdprConsent) {
      payload.user = {ext: {consent: bidderRequest.gdprConsent.consentString}};
      const gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
      payload.regs = {ext: {gdpr: gdpr}};
    }

    return {
      method: 'POST',
      url: URL,
      data: JSON.stringify(payload),
      bidderRequest
    };
  }
141698
def _get(self, url, params={}):
        """"""
        r = requests.get(self._api_prefix + url,
            params=params,
            headers=self.headers,
            auth=self.auth,
        )
        return self._action(r)