<commit_before>package lila.common
package paginator

abstract class AdapterLike[A](implicit ec: scala.concurrent.ExecutionContext) {

  /** Returns the total number of results.
    */
  def nbResults: Fu[Int]

  /** Returns a slice of the results.
    *
    * @param   offset    The number of elements to skip, starting from zero
    * @param   length    The maximum number of elements to return
    */
  def slice(offset: Int, length: Int): Fu[Seq[A]]

  def map[B](f: A => B): AdapterLike[B] =
    new AdapterLike[B] {

      def nbResults = AdapterLike.this.nbResults

      def slice(offset: Int, length: Int) =
        AdapterLike.this.slice(offset, length) dmap { _ map f }
    }

  def mapFuture[B](f: A => Fu[B]): AdapterLike[B] =
    new AdapterLike[B] {

      def nbResults = AdapterLike.this.nbResults

      def slice(offset: Int, length: Int) =
        AdapterLike.this.slice(offset, length) flatMap { _.map(f).sequenceFu }
    }

  def mapFutureList[B](f: Seq[A] => Fu[Seq[B]]): AdapterLike[B] =
    new AdapterLike[B] {

      def nbResults = AdapterLike.this.nbResults

      def slice(offset: Int, length: Int) =
        AdapterLike.this.slice(offset, length) flatMap f<commit_msg>remove now unused function<commit_after>package lila.common
package paginator

abstract class AdapterLike[A](implicit ec: scala.concurrent.ExecutionContext) {

  /** Returns the total number of results.
    */
  def nbResults: Fu[Int]

  /** Returns a slice of the results.
    *
    * @param   offset    The number of elements to skip, starting from zero
    * @param   length    The maximum number of elements to return
    */
  def slice(offset: Int, length: Int): Fu[Seq[A]]

  def map[B](f: A => B): AdapterLike[B] =
    new AdapterLike[B] {

      def nbResults = AdapterLike.this.nbResults

      def slice(offset: Int, length: Int) =
        AdapterLike.this.slice(offset, length) dmap { _ map f }
    }

  def mapFutureList[B](f: Seq[A] => Fu[Seq[B]]): AdapterLike[B] =
    new AdapterLike[B] {

      def nbResults = AdapterLike.this.nbResults

      def slice(offset: Int, length: Int) =
        AdapterLike.this.slice(offset, length) flatMap f
{'fraction_non_alphanumeric': 0.11740139211136891, 'fraction_numerical': 0.0, 'mean_word_length': 3.0679245283018868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '2972138', 'n_tokens_mistral': 717, 'n_tokens_neox': 692, 'n_words': 199}