<commit_before>package org.allenai.common

object Resource {
  // Allow use of methods on structural types.
  import scala.language.reflectiveCalls

  type Closeable = { def close(): Unit }

  /** A method for managing a simple resource.  After running a computation,
    * the resource will be closed and the computation will be returned.
    *
    * More complicated resource management may warrant a dependency on
    * "com.jsuereth" % "scala-arm", but this simple method handles most
    * cases.
    *
    * @param  resource  a closeable resource
    * @param  f  a computation involving the supplied resource
    * @returns  the result of the computation over the resource
    */
  def using[A <: Closeable, B](resource: A)(f: A => B) {
    require(resource != null, "The supplied resource was null.")
    try {
      f(resource)
    } finally {
      resource.close()
    }
  }
}
<commit_msg>Fix return type of Resource.using<commit_after>package org.allenai.common

object Resource {
  // Allow use of methods on structural types.
  import scala.language.reflectiveCalls

  type Closeable = { def close(): Unit }

  /** A method for managing a simple resource.  After running a computation,
    * the resource will be closed and the computation will be returned.
    *
    * More complicated resource management may warrant a dependency on
    * "com.jsuereth" % "scala-arm", but this simple method handles most
    * cases.
    *
    * @param  resource  a closeable resource
    * @param  f  a computation involving the supplied resource
    * @returns  the result of the computation over the resource
    */
  def using[A <: Closeable, B](resource: A)(f: A => B): B = {
    require(resource != null, "The supplied resource was null.")
    try {
      f(resource)
    } finally {
      resource.close()
    }
  }
}

{'fraction_non_alphanumeric': 0.08821917808219178, 'fraction_numerical': 0.0, 'mean_word_length': 2.9017094017094016, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3947792', 'n_tokens_mistral': 503, 'n_tokens_neox': 498, 'n_words': 201}