<commit_before>package example.travel
package snippet

import scala.xml.NodeSeq
import net.liftweb.util.Helpers._
import example.travel.model.Customer
import example.travel.lib.AuctionHelpers

class Basket extends AuctionHelpers {
  private lazy val contents = 
    Customer.currentUser.flatMap(_.order.map(_.order_auctions.all)).openOr(Nil)
  
  def items = (if (contents.isEmpty) {"*" #> (y=>y)} else {"*" #> contents.map(x => single(x.auction.obj))}) &
    "%s ^*".format(if(contents.isEmpty) "empty" else "full") #> NodeSeq.Empty
}<commit_msg>Better solution until 2.4, see http://www.assembla.com/spaces/liftweb/tickets/971<commit_after>package example.travel
package snippet

import scala.xml.NodeSeq
import net.liftweb.util.Helpers._
import example.travel.model.Customer
import example.travel.lib.AuctionHelpers

class Basket extends AuctionHelpers {
  private lazy val contents = 
    Customer.currentUser.flatMap(_.order.map(_.order_auctions.all)).openOr(Nil)
  
  def items = "full *" #> contents.map(x => single(x.auction.obj)) andThen
    "%s ^*".format(if(contents.isEmpty) "empty" else "full") #> NodeSeq.Empty
}
{'fraction_non_alphanumeric': 0.14209591474245115, 'fraction_numerical': 0.004440497335701598, 'mean_word_length': 4.962962962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2558803', 'n_tokens_mistral': 379, 'n_tokens_neox': 368, 'n_words': 73}