<commit_before>package example

import scala.scalajs.js
import js.annotation.JSExport
import org.scalajs.dom
import scala.scalajs.js.annotation.JSName
import js.Dynamic.{global => g, newInstance => jsnew, literal => lit}

@JSName("THREE.Scene")
class ThreeScene

trait DojoComponent extends js.Object {
  def addChild(child: DojoComponent) = ???
}

@JSName("BorderContainer")
trait BorderContainer extends DojoComponent {
  val id: String = ???
}

@JSName("ContentPane")
trait ContentPane extends DojoComponent {
  val id: String = ???
  val region: String = ???
  var selected: Boolean = ???
  val title: String = ???
}

object ContentPane {
  def apply(id: String)(implicit contentPane: js.Dynamic) = jsnew(contentPane)(id)
}

@JSName("Grid")
trait OnDemandGrid extends DojoComponent {
  def renderArray(data: js.Object): Any = ???

  def save(): Unit = ???

  def revert(): Unit = ???

  val id: String = ???
}

object OnDemandGrid {
  def apply(id: String, columns: List[ColumnDef])(implicit grid: js.Dynamic) =
    jsnew(grid)(js.Dictionary("columns" -> js.Dictionary(columns.map(col => (col.fieldName, col.title)): _*)), id).asInstanceOf[OnDemandGrid]

}

case class ColumnDef(fieldName: String, title: String)

@JSExport
object ScalaJSExample {
  @JSExport
  def main(): Unit = {
    val paragraph = g.document.createElement("p")
    paragraph.innerHTML = s"<strong>It worked!</strong>"
    g.document.getElementById("playground").appendChild(paragraph)

    val pp = dom.document.createElement("p")

    val playground = g.document.getElementById("playground")
    List(1, 2, 3).foreach {
      i =>
        val elem = g.document.createElement("p")
        elem.innerHTML = s"Here is $i"
        playground.appendChild(elem)
    }

    val scene = (new ThreeScene).asInstanceOf[js.Dynamic]

    val threeS = scene.asInstanceOf[ThreeScene]


    val bc = dom.document.createElement("div")
    bc.id = "bordercontainer"
    dom.document.body.appendChild(bc)

    g.require(Array[String]("dijit/layout/BorderContainer", "dijit/layout/ContentPane",
      "dojo/domReady!"), {
      (borderContainer: js.Dynamic, contentPane: js.Dynamic) =>
        val cont1 = jsnew(borderContainer)({}, "bordercontainer")
        val pp = dom.document.createElement("p")
        pp.innerHTML = "testing, testing"
        cont1.domNode.appendChild(pp)

        val top = jsnew(contentPane)()
        top.region = "top"
        cont1.addChild(top)
        cont1.startup()
    })

    g.require(Array[String]("dgrid/Grid", "dojo/domReady!"), {
      (grid: js.Dynamic) =>

        val odg = OnDemandGrid("grid3", List(ColumnDef("name", "Name"), ColumnDef("rank", "Rank"), ColumnDef("serial", "Serial Number")))(grid)

      val army = Array(new Soldier("Fred", "Barkers", 89), new Soldier("Vanna", "Blue", 55),
        new Soldier("Pat", "Sajak", 65))

      odg.renderArray(army)
      g.console.log(odg.id)
    })

  }
}

  @JSExport
  class Soldier(val _name: String, val _rank: String, val _serial: Int) {
    @JSExport
    val name = _name
    @JSExport
    val rank = _rank
    @JSExport
    val serial = _serial
  }
<commit_msg>Only a single require section<commit_after>package example

import scala.scalajs.js
import js.annotation.JSExport
import org.scalajs.dom
import scala.scalajs.js.annotation.JSName
import js.Dynamic.{global => g, newInstance => jsnew, literal => lit}

@JSName("THREE.Scene")
class ThreeScene

trait DojoComponent extends js.Object {
  def addChild(child: DojoComponent) = ???
}

@JSName("BorderContainer")
trait BorderContainer extends DojoComponent {
  val id: String = ???
}

@JSName("ContentPane")
trait ContentPane extends DojoComponent {
  val id: String = ???
  val region: String = ???
  var selected: Boolean = ???
  val title: String = ???
}

object ContentPane {
  def apply(id: String)(implicit contentPane: js.Dynamic) = jsnew(contentPane)(id)
}

@JSName("Grid")
trait OnDemandGrid extends DojoComponent {
  def renderArray(data: js.Object): Any = ???

  def save(): Unit = ???

  def revert(): Unit = ???

  val id: String = ???
}

object OnDemandGrid {
  def apply(id: String, columns: List[ColumnDef])(implicit grid: js.Dynamic) =
    jsnew(grid)(js.Dictionary("columns" -> js.Dictionary(columns.map(col => (col.fieldName, col.title)): _*)), id).asInstanceOf[OnDemandGrid]

}

case class ColumnDef(fieldName: String, title: String)

@JSExport
object ScalaJSExample {
  @JSExport
  def main(): Unit = {
    val paragraph = g.document.createElement("p")
    paragraph.innerHTML = s"<strong>It worked!</strong>"
    g.document.getElementById("playground").appendChild(paragraph)

    val pp = dom.document.createElement("p")

    val playground = g.document.getElementById("playground")
    List(1, 2, 3).foreach {
      i =>
        val elem = g.document.createElement("p")
        elem.innerHTML = s"Here is $i"
        playground.appendChild(elem)
    }

    val scene = (new ThreeScene).asInstanceOf[js.Dynamic]

    val threeS = scene.asInstanceOf[ThreeScene]


    val bc = dom.document.createElement("div")
    bc.id = "bordercontainer"
    dom.document.body.appendChild(bc)

    g.require(Array[String]("dijit/layout/BorderContainer",
      "dijit/layout/ContentPane",
      "dgrid/Grid",
      "dojo/domReady!"), {
      (borderContainer: js.Dynamic, contentPane: js.Dynamic) =>
        val cont1 = jsnew(borderContainer)({}, "bordercontainer")
        val pp = dom.document.createElement("p")
        pp.innerHTML = "testing, testing"
        cont1.domNode.appendChild(pp)

        val top = jsnew(contentPane)()
        top.region = "top"
        cont1.addChild(top)
        cont1.startup()

        val odg = OnDemandGrid("grid3", List(ColumnDef("name", "Name"), ColumnDef("rank", "Rank"), ColumnDef("serial", "Serial Number")))(grid)

        val army = Array(new Soldier("Fred", "Barkers", 89), new Soldier("Vanna", "Blue", 55),
          new Soldier("Pat", "Sajak", 65))

        odg.renderArray(army)
    })

  }
}

@JSExport
class Soldier(val _name: String, val _rank: String, val _serial: Int) {
  @JSExport
  val name = _name
  @JSExport
  val rank = _rank
  @JSExport
  val serial = _serial
}

{'fraction_non_alphanumeric': 0.14667100765098487, 'fraction_numerical': 0.004558033534103858, 'mean_word_length': 3.6722433460076047, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, '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': '4032102', 'n_tokens_mistral': 2026, 'n_tokens_neox': 1975, 'n_words': 442}