<commit_before>package org.talkingpuffin.ui

import java.util.concurrent.{Executors, Callable}
import javax.swing.SwingWorker
import swing.event.Event
import swing.Publisher
import org.talkingpuffin.Session
import org.talkingpuffin.twitter.PageHandler._
import twitter4j.User

case class IdsChanged(source: Relationships) extends Event
case class UsersChanged(source: Relationships) extends Event

class Relationships extends Publisher with ErrorHandler {
  var friendIds = List[Long]()
  var followerIds = List[Long]()
  var friends = List[User]()
  var followers = List[User]()

  /**
   * Uses the provided Twitter to get all friends and followers (doing the
   * fetches in parallel to be quicker), and publishes the results in the event-dispatching thread when done.
   */
  def getUsers(session: Session, screenName: String, longOpListener: LongOpListener) {
    val tw = session.twitter
    longOpListener.startOperation
    type Users = List[User]
    val pool = Executors.newFixedThreadPool(2)

    val friendsFuture   = pool.submit(new Callable[Users] { def call = {allPages(friendsStatuses(tw, screenName), -1)}})
    val followersFuture = pool.submit(new Callable[Users] { def call = {allPages(followersStatuses(tw, screenName), -1)}})

    new SwingWorker[Tuple2[Users,Users], Object] {
      def doInBackground = (friendsFuture.get, followersFuture.get)
      override def done {
        longOpListener.stopOperation
        doAndHandleError(() => {<commit_msg>Take advantage of default parameter<commit_after>package org.talkingpuffin.ui

import java.util.concurrent.{Executors, Callable}
import javax.swing.SwingWorker
import swing.event.Event
import swing.Publisher
import org.talkingpuffin.Session
import org.talkingpuffin.twitter.PageHandler._
import twitter4j.User

case class IdsChanged(source: Relationships) extends Event
case class UsersChanged(source: Relationships) extends Event

class Relationships extends Publisher with ErrorHandler {
  var friendIds = List[Long]()
  var followerIds = List[Long]()
  var friends = List[User]()
  var followers = List[User]()

  /**
   * Uses the provided Twitter to get all friends and followers (doing the
   * fetches in parallel to be quicker), and publishes the results in the event-dispatching thread when done.
   */
  def getUsers(session: Session, screenName: String, longOpListener: LongOpListener) {
    val tw = session.twitter
    longOpListener.startOperation
    type Users = List[User]
    val pool = Executors.newFixedThreadPool(2)

    val friendsFuture   = pool.submit(new Callable[Users] { def call = {allPages(friendsStatuses(tw, screenName))}})
    val followersFuture = pool.submit(new Callable[Users] { def call = {allPages(followersStatuses(tw, screenName))}})

    new SwingWorker[Tuple2[Users,Users], Object] {
      def doInBackground = (friendsFuture.get, followersFuture.get)
      override def done {
        longOpListener.stopOperation
        doAndHandleError(() => {
{'fraction_non_alphanumeric': 0.09109311740890688, 'fraction_numerical': 0.002699055330634278, 'mean_word_length': 4.669216061185469, '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': '2652139', 'n_tokens_mistral': 865, 'n_tokens_neox': 832, 'n_words': 246}