Returns stock prices for Google company.
971455
def fetch_googl():
    """"""
    yql = YQL('GOOGL', '2014-01-01', '2014-01-10')

    for item in yql:
        print item.get('date'), item.get('price')

    yql.select('GOOGL', '2014-01-01', '2014-01-10')

    for item in yql:
        print item.get('date'), item.get('price')
1236290
def getAll(self, symbol):
        
        values = self.__request(symbol, 'l1c1va2xj1b4j4dyekjm3m4rr5p5p6s7').split(',')
        data = {}
        data['price'] = values[0]
        data['change'] = values[1]
        data['volume'] = values[2]
        data['avg_daily_volume'] = values[3]
        data['stock_exchange'] = values[4]
        data['market_cap'] = values[5]
        data['book_value'] = values[6]
        data['ebitda'] = values[7]
        data['dividend_per_share'] = values[8]
        data['dividend_yield'] = values[9]
        data['earnings_per_share'] = values[10]
        data['52_week_high'] = values[11]
        data['52_week_low'] = values[12]
        data['50day_moving_avg'] = values[13]
        data['200day_moving_avg'] = values[14]
        data['price_earnings_ratio'] = values[15]
        data['price_earnings_growth_ratio'] = values[16]
        data['price_sales_ratio'] = values[17]
        data['price_book_ratio'] = values[18]
        data['short_ratio'] = values[19]
        return data
1009999
def symbol_bollinger(symbol='GOOG',
    start=datetime.datetime(2008, 1, 1), end=datetime.datetime(2009, 12, 31), price_type='close', cleaner=clean_dataframe,
    window=20, sigma=1.):
    
    symbols = normalize_symbols(symbol)
    prices = price_dataframe(symbols, start=start, end=end, price_type=price_type, cleaner=cleaner)
    return series_bollinger(prices[symbols[0]], window=window, sigma=sigma, plot=False)
863042
def portfolio_value(portfolio, date, price='close'):
    
    value = 0.0
    for (sym, sym_shares) in portfolio.iteritems():
        sym_price = None
        if sym_shares:
            sym_price = get_price(symbol=sym, date=date, price=price)
        # print sym, sym_shares, sym_price
        # print last_date, k, price
        if sym_price != None:
            if np.isnan(sym_price):
                print 'Invalid price, shares, value, total: ', sym_price, sym_shares, (float(sym_shares) * float(sym_price)) if sym_shares and sym_price else 'Invalid', value
                if sym_shares:
                    return float('nan')
            else:
                # print ('{0} shares of {1} = {2} * {3} = {4}'.format(sym_shares, sym, sym_shares, sym_price, sym_shares * sym_price))
                value += sym_shares * sym_price
                # print 'new price, value = {0}, {1}'.format(sym_price, value)
    return value
664
def get_quantity(self) -> Decimal:
        
        from pydatum import Datum
        # Use today's date but reset hour and lower.
        today = Datum()
        today.today()
        today.end_of_day()
        return self.get_num_shares_on(today.value)
1360316
public function getCalculatedPrice($spread_type, $spread_value, $stock_price, $product_price_charmer, $currency)
    {
        $price = $stock_price;

        switch($spread_type) {
            case 0;
                $price = $this->calculateProductsPriceByFlat($spread_value, $stock_price, $currency);
                break;
            case 1:
                $price = $this->calculateProductsPriceByPercent($spread_value, $stock_price, $currency);
                break;
        }

        $price = round($price, 2);

        if($product_price_charmer) {
            $price = $this->priceAdjuster($price);
        }

        return $price;
    }
946908
def __getCashToBuyStock(self):
        '''  '''
        account=self.__strategy.getAccountCopy()

        if (account.buyingPower >= account.getTotalValue() / self.__buyingRatio):
            return account.getTotalValue() / self.__buyingRatio
        else:
            return 0
17942
public com.google.api.ads.admanager.axis.v201805.Money getRate() {
        return rate;
    }
641575
@RequestMapping(value = "/listPriceByPeriod", method = RequestMethod.GET)
	
	public @ResponseBody
	JsonNode listPriceByPeriod(
			@RequestParam(value = "stockName", required = true) String stockName,
			@RequestParam(value = "period", required = true) PERIOD period) {
		logger.debug("Received request to list gedik stocks");
		
		JsonNode priceList = myNetFinansService.getPricesByPeriod(stockName, period);
		
		return priceList;

	}
627098
def hold_price(self, datetime=None):
        

        def weights(x):
            if sum(x['amount']) != 0:
                return np.average(
                    x['price'],
                    weights=x['amount'],
                    returned=True
                )
            else:
                return np.nan

        if datetime is None:
            return self.history_table.set_index(
                'datetime',
                drop=False
            ).sort_index().groupby('code').apply(weights).dropna()
        else:
            return self.history_table.set_index(
                'datetime',
                drop=False
            ).sort_index().loc[:datetime].groupby('code').apply(weights
                                                               ).dropna()
290591
def getprice(self):
        
        target = self.bot.get("target", {})
        if target.get("reference") == "feed":
            assert self.market == self.market.core_quote_market(), "Wrong market for 'feed' reference!"
            ticker = self.market.ticker()
            price = ticker.get("quoteSettlement_price")
            assert abs(price["price"]) != float("inf"), "Check price feed of asset! (%s)" % str(price)
        return price
809348
def Task_display(self):
    
    re = """%(stock_name)s %(stock_no)s %(stock_date)s
Today: %(stock_price)s %(stock_range)s
=-=-=-=""" % {
        'stock_name': unicode(self.stock_name),
        'stock_no': unicode(self.stock_no),
        'stock_date': unicode(self.data_date[-1]),
        'stock_price': unicode(self.raw_data[-1]),
        'stock_range': unicode(self.stock_range[-1]),
      }
    return re
279336
def get_price_as_of(self, stock: Commodity, on_date: datetime):
        
        # return self.get_price_as_of_query(stock, on_date).first()
        prices = PriceDbApplication()
        prices.get_prices_on(on_date.date().isoformat(), stock.namespace, stock.mnemonic)
1098292
@Override
	public List<CommercePriceEntry> findByCompanyId(long companyId) {
		return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
			null);
	}
1277686
def get(company='', company_uri=''):
    """"""
    if not company and not company_uri:
        raise Exception("glassdoor.gd.get(company='', company_uri=''): "\
                            " company or company_uri required")
    payload = {}
    if not company_uri:
        payload.update({'clickSource': 'searchBtn',
                        'sc.keyword': company
                        })
        uri = '%s/%s' % (GLASSDOOR_API, REVIEWS_URL)
    else:
        uri = '%s%s' % (GLASSDOOR_API, company_uri)
    r = requests.get(uri, params=payload)
    soup = BeautifulSoup(r.content)
    results = parse(soup)
    return results
959362
def google(self):
        """"""
        tms_x, tms_y = self.tms
        return tms_x, (2 ** self.zoom - 1) - tms_y
915873
def ticker(rest):
	""
	ticker = rest.upper()
	# let's use Yahoo's nifty csv facility, and pull last time/price both
	symbol = 's'
	last_trade_price = 'l1'
	last_trade_time = 't1'
	change_percent = 'p2'
	format = ''.join((symbol, last_trade_time, last_trade_price, change_percent))
	url = (
		'http://finance.yahoo.com/d/quotes.csv?s=%(ticker)s&f=%(format)s'
		% locals())
	stock_info = csv.reader(util.open_url(url).text.splitlines())
	last_trade, = stock_info
	ticker_given, time, price, diff = last_trade
	if ticker_given != ticker:
		return "d'oh... could not find information for symbol %s" % ticker
	return '%(ticker)s at %(time)s (ET): %(price)s (%(diff)s)' % locals()