def price_as_of(quote, as_of):
  
  if quote.cash_equivalent or quote.last_trade.date() == as_of:
    return quote.price
  else:
    candidates = quote.pricehistory_set.filter(as_of_date__lte = as_of.strftime('%Y-%m-%d')).order_by('-as_of_date')[0:1]
    return (candidates[0].price if candidates.count() > 0 else 0)
Parse item which is enclosed by '%{}' in key/value
dataset/ETHPy150Open fxdemolisher/frano/frano/quotes/models.py/price_as_of--crossover with--dataset/ETHPy150Open XiaoMi/minos/client/service_config.py/ServiceConfig.parse_item