<commit_before>class ActivityAppController extends AppController

  KD.registerAppClass @,
    name         : "Activity"
    route        : "Activity"
    hiddenHandle : yes

  activityTypes = [
      'CStatusActivity'
      'CCodeSnipActivity'
      'CFollowerBucketActivity'
      'CNewMemberBucketActivity'
      'CDiscussionActivity'
      'CTutorialActivity'
      'CInstallerBucketActivity'
      'CBlogPostActivity'
    ]

  lastTo    = null
  lastFrom  = null
  aRange    = 2*60*60*1000
  isLoading = no

  @clearQuotes = clearQuotes = (activities)->

    return activities = for activityId, activity of activities
      activity.snapshot = activity.snapshot?.replace /&quot;/g, '"'
      activity


  constructor:(options={})->

    options.view    = new ActivityAppView
    options.appInfo =
      name          : 'Activity'

    super options

    @currentFilter     = activityTypes
    @appStorage        = new AppStorage 'Activity', '1.0'
    activityController = @getSingleton('activityController')
    activityController.on "ActivityListControllerReady", @attachEvents.bind @

  loadView:->
    if @listController then @populateActivity()
    else
      ac = @getSingleton('activityController')
      ac.once "ActivityListControllerReady", @bound "populateActivity"

  resetList:->

    lastFrom = null
    lastTo   = null
    @listController.removeAllItems()

  setFilter:(type) -> @currentFilter = if type? then [type] else activityTypes

  getFilter: -> @currentFilter

  ownActivityArrived:(activity)-> @listController.ownActivityArrived activity

  fetchCurrentGroup:(callback)-> callback @currentGroupSlug

  attachEvents:(controller)->

    @listController    = controller
    activityController = @getSingleton('activityController')

    controller.on 'LazyLoadThresholdReached', @continueLoadingTeasers.bind @
    controller.on 'teasersLoaded', @teasersLoaded.bind @<commit_msg>Wait until appIsReady<commit_after>class ActivityAppController extends AppController

  KD.registerAppClass @,
    name         : "Activity"
    route        : "Activity"
    hiddenHandle : yes

  activityTypes = [
      'CStatusActivity'
      'CCodeSnipActivity'
      'CFollowerBucketActivity'
      'CNewMemberBucketActivity'
      'CDiscussionActivity'
      'CTutorialActivity'
      'CInstallerBucketActivity'
      'CBlogPostActivity'
    ]

  lastTo    = null
  lastFrom  = null
  aRange    = 2*60*60*1000
  isLoading = no

  @clearQuotes = clearQuotes = (activities)->

    return activities = for activityId, activity of activities
      activity.snapshot = activity.snapshot?.replace /&quot;/g, '"'
      activity


  constructor:(options={})->

    options.view    = new ActivityAppView
    options.appInfo =
      name          : 'Activity'

    super options

    @currentFilter     = activityTypes
    @appStorage        = new AppStorage 'Activity', '1.0'

    @mainController = @getSingleton 'mainController'
    @mainController.on 'AppIsReady', =>
      activityController = @getSingleton('activityController')
      activityController.on   "ActivityListControllerReady", @attachEvents.bind @
      activityController.once "ActivityListControllerReady", @bound "populateActivity"

  loadView:->
    @populateActivity() if @listController

  resetList:->

    lastFrom = null
    lastTo   = null
    @listController.removeAllItems()

  setFilter:(type) -> @currentFilter = if type? then [type] else activityTypes

  getFilter: -> @currentFilter

  ownActivityArrived:(activity)-> @listController.ownActivityArrived activity

  fetchCurrentGroup:(callback)-> callback @currentGroupSlug

  attachEvents:(controller)->

    @listController    = controller
    activityController = @getSingleton('activityController')

    controller.on 'LazyLoadThresholdReached', @continueLoadingTeasers.bind @
    controller.on 'teasersLoaded', @teasersLoaded.bind @
{'fraction_non_alphanumeric': 0.09568140677527799, 'fraction_numerical': 0.005689164727178691, 'mean_word_length': 3.4510932105868815, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6204979', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1035, 'n_words': 219}