<commit_before>package im.mange.jetboot.widget

import im.mange.jetboot.{R, Renderable}
import im.mange.jetboot.widget.table._

object SimpleTable {
  //TIP: http://spray.io/blog/2012-12-13-the-magnet-pattern/
  sealed trait RenderableMagnet {
    def apply(): Renderable
  }

  implicit def fromString(ss: String) = new RenderableMagnet {
      def apply() = R(ss)
    }

  implicit def fromR(r: Renderable) = new RenderableMagnet {
      def apply() = r
    }

  def table(headers: TableHeaders, rows: TableRow*) = Table(TableModel(headers, rows.toList))
  def table(headers: TableHeaders, rows: List[TableRow]) = Table(TableModel(headers, rows))
  def headers(tableHeaders: TableHeader*) = TableHeaders(tableHeaders.toList)
  def headers(tableHeaders: List[TableHeader]) = TableHeaders(tableHeaders)
  def header(r: Renderable) = TableHeader(r)
  def header(s: String) = TableHeader(R(s))
  def rows(rows: TableRow*) = rows.toList
  def rows(rows: List[TableRow]) = rows
  def trow(magnets: RenderableMagnet*): TableRow = TableRow(magnets.map(_.apply()))
  def trow(magnets: List[RenderableMagnet]): TableRow = TableRow(magnets.map(_.apply()))
}<commit_msg>a little tidy up<commit_after>package im.mange.jetboot.widget

import im.mange.jetboot.{R, Renderable}
import im.mange.jetboot.widget.table._

object SimpleTable {
  //TIP: http://spray.io/blog/2012-12-13-the-magnet-pattern/
  sealed trait RenderableMagnet { def apply(): Renderable }
  implicit def fromString(ss: String) = new RenderableMagnet { def apply() = R(ss) }
  implicit def fromR(r: Renderable) = new RenderableMagnet { def apply() = r }

  def table(headers: TableHeaders, rows: TableRow*) = Table(TableModel(headers, rows.toList))
  def table(headers: TableHeaders, rows: List[TableRow]) = Table(TableModel(headers, rows))
  def headers(tableHeaders: TableHeader*) = TableHeaders(tableHeaders.toList)
  def headers(tableHeaders: List[TableHeader]) = TableHeaders(tableHeaders)
  def header(r: Renderable) = TableHeader(r)
  def header(s: String) = TableHeader(R(s))
  def rows(rows: TableRow*) = rows.toList
  def rows(rows: List[TableRow]) = rows
  def trow(magnets: RenderableMagnet*): TableRow = TableRow(magnets.map(_.apply()))
  def trow(magnets: List[RenderableMagnet]): TableRow = TableRow(magnets.map(_.apply()))
}
{'fraction_non_alphanumeric': 0.13594771241830064, 'fraction_numerical': 0.006971677559912854, 'mean_word_length': 5.3076923076923075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '528195', 'n_tokens_mistral': 779, 'n_tokens_neox': 772, 'n_words': 169}