<commit_before>package uk.ac.wellcome.platform.api

import uk.ac.wellcome.models._
import uk.ac.wellcome.platform.api.models.DisplayWork

trait WorksUtil {

  val canonicalId = "1234"
  val title = "this is the first image title"
  val description = "this is a description"
  val lettering = "some lettering"

  val period = Period("the past")
  val agent = Agent("a person")

  def convertWorkToDisplayWork(work: IdentifiedWork) = DisplayWork(
    work.canonicalId,
    work.work.title,
    work.work.description,
    work.work.lettering,
    work.work.createdDate,
    work.work.creators
  )

  def createIdentifiedWorks(count: Int): Seq[IdentifiedWork] =
    (1 to count).map(
      (idx: Int) =>
        identifiedWorkWith(
          canonicalId = s"${idx}-${canonicalId}",
          title = s"${idx}-${title}",
          description = s"${idx}-${description}",
          lettering = s"${idx}-${lettering}",
          createdDate = period.copy(title = s"${idx}-${period.title}"),
          creator = agent.copy(title = s"${idx}-${agent.title}")
      ))

  def identifiedWorkWith(canonicalId: String, title: String): IdentifiedWork =
    IdentifiedWork(canonicalId,
                   Work(identifiers =
                          List(SourceIdentifier("Miro", "MiroID", "5678")),
                        title = title))

  def identifiedWorkWith(canonicalId: String,
                         title: String,
                         identifiers: List[SourceIdentifier]): IdentifiedWork =
    IdentifiedWork(canonicalId, Work(identifiers = identifiers, title = title))

  def identifiedWorkWith(canonicalId: String,
                         title: String,
                         description: String,
                         lettering: String,
                         createdDate: Period,
                         creator: Agent): IdentifiedWork = IdentifiedWork(
    canonicalId = canonicalId,
    work = Work(
      identifiers = List(SourceIdentifier("Miro", "MiroID", "5678")),
      title = title,
      description = Some(description),
      lettering = Some(lettering),
      createdDate = Some(createdDate),<commit_msg>no need to copy agent/period<commit_after>package uk.ac.wellcome.platform.api

import uk.ac.wellcome.models._
import uk.ac.wellcome.platform.api.models.DisplayWork

trait WorksUtil {

  val canonicalId = "1234"
  val title = "this is the first image title"
  val description = "this is a description"
  val lettering = "some lettering"

  val period = Period("the past")
  val agent = Agent("a person")

  def convertWorkToDisplayWork(work: IdentifiedWork) = DisplayWork(
    work.canonicalId,
    work.work.title,
    work.work.description,
    work.work.lettering,
    work.work.createdDate,
    work.work.creators
  )

  def createIdentifiedWorks(count: Int): Seq[IdentifiedWork] =
    (1 to count).map(
      (idx: Int) =>
        identifiedWorkWith(
          canonicalId = s"${idx}-${canonicalId}",
          title = s"${idx}-${title}",
          description = s"${idx}-${description}",
          lettering = s"${idx}-${lettering}",
          createdDate = Period(s"${idx}-${period.label}"),
          creator = Agent(s"${idx}-${agent.label}")
      ))

  def identifiedWorkWith(canonicalId: String, title: String): IdentifiedWork =
    IdentifiedWork(canonicalId,
                   Work(identifiers =
                          List(SourceIdentifier("Miro", "MiroID", "5678")),
                        title = title))

  def identifiedWorkWith(canonicalId: String,
                         title: String,
                         identifiers: List[SourceIdentifier]): IdentifiedWork =
    IdentifiedWork(canonicalId, Work(identifiers = identifiers, title = title))

  def identifiedWorkWith(canonicalId: String,
                         title: String,
                         description: String,
                         lettering: String,
                         createdDate: Period,
                         creator: Agent): IdentifiedWork = IdentifiedWork(
    canonicalId = canonicalId,
    work = Work(
      identifiers = List(SourceIdentifier("Miro", "MiroID", "5678")),
      title = title,
      description = Some(description),
      lettering = Some(lettering),
      createdDate = Some(createdDate),
{'fraction_non_alphanumeric': 0.1168586879849518, 'fraction_numerical': 0.006113331765812368, 'mean_word_length': 2.3869426751592355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3631930', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1136, 'n_words': 257}