<commit_before>class SidebarMachineList extends KDCustomHTMLView

  constructor: (options = {}, data) ->

    options.tagName        = 'section'
    options.title        or= ''
    options.cssClass       = KD.utils.curry 'vms', options.cssClass
    options.hasPlusIcon   ?= no

    super options, data

    @header = new KDCustomHTMLView
      tagName  : 'h3'
      cssClass : 'sidebar-title'
      partial  : options.title
      click    : => @emit 'ListHeaderClicked'

    if options.hasPlusIcon
      @header.addSubView new CustomLinkView
        cssClass : 'add-icon buy-vm'
        title    : ' '
        click    : (e) =>
          KD.utils.stopDOMEvent e
          @emit 'ListHeaderPlusIconClicked'

    @addSubView @header

    for machineData in data
      @addSubView new SidebarMachineBox {}, machineData<commit_msg>SidebarMachineList: Cache machineBox instances in MachineList class.<commit_after>class SidebarMachineList extends KDCustomHTMLView

  constructor: (options = {}, data) ->

    options.tagName        = 'section'
    options.title        or= ''
    options.cssClass       = KD.utils.curry 'vms', options.cssClass
    options.hasPlusIcon   ?= no

    super options, data

    @header = new KDCustomHTMLView
      tagName  : 'h3'
      cssClass : 'sidebar-title'
      partial  : options.title
      click    : => @emit 'ListHeaderClicked'

    if options.hasPlusIcon
      @header.addSubView new CustomLinkView
        cssClass : 'add-icon buy-vm'
        title    : ' '
        click    : (e) =>
          KD.utils.stopDOMEvent e
          @emit 'ListHeaderPlusIconClicked'

    @addSubView @header

    @machineBoxes = []

    for machineData in data

      machineBox = new SidebarMachineBox {}, machineData
      @addSubView machineBox
      @machineBoxes.push machineBox

{'fraction_non_alphanumeric': 0.08939478067740145, 'fraction_numerical': 0.001110494169905608, 'mean_word_length': 2.361940298507463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5213788', 'n_tokens_mistral': 545, 'n_tokens_neox': 522, 'n_words': 124}