<commit_before>class ConsiderIt.ProposalList extends Backbone.Paginator.clientPager
  model: ConsiderIt.Proposal

  paginator_ui: 
    firstPage: 1
    currentPage: 1
    perPage: 5

  initialize: (options) -> 
    super

    ####################################
    # patch for Backbone.paginator
    @origModels = if @models then @models.slice() else []
    ####################################

    @on 'add', (model) =>
      model.long_id = model.get('long_id')
      model.set('description', htmlFormat(model.attributes.description))

    @listenTo ConsiderIt.router, 'user:signin', =>
    @listenTo ConsiderIt.router, 'user:signout', => 
      @purge_inaccessible()



  add_proposals : (proposals_data) ->
    proposals = []

    for prop in proposals_data

      if !(@get(prop.model.proposal.id)?)
        top_pro = if prop.top_pro then prop.top_pro.point else null
        top_con = if prop.top_con then prop.top_con.point else null
        proposal = new ConsiderIt.Proposal(prop.model.proposal, top_pro, top_con)
        proposals.push(proposal)

    @add proposals
    ConsiderIt.all_proposals.add proposals if ConsiderIt.app? && ConsiderIt.all_proposals != @
    # Watchout! sometimes the collection won't keep the same proposal object, so ConsiderIt.all_proposals might be out of sync with @collection

  add_proposal : (proposal_data) ->  <commit_msg>removing unneeded check<commit_after>class ConsiderIt.ProposalList extends Backbone.Paginator.clientPager
  model: ConsiderIt.Proposal

  paginator_ui: 
    firstPage: 1
    currentPage: 1
    perPage: 5

  initialize: (options) -> 
    super

    ####################################
    # patch for Backbone.paginator
    @origModels = if @models then @models.slice() else []
    ####################################

    @on 'add', (model) =>
      model.long_id = model.get('long_id')
      model.set('description', htmlFormat(model.attributes.description))

    @listenTo ConsiderIt.router, 'user:signin', =>
    @listenTo ConsiderIt.router, 'user:signout', => 
      @purge_inaccessible()



  add_proposals : (proposals_data) ->
    proposals = []

    for prop in proposals_data

      if !(@get(prop.model.proposal.id)?)
        top_pro = if prop.top_pro then prop.top_pro.point else null
        top_con = if prop.top_con then prop.top_con.point else null
        proposal = new ConsiderIt.Proposal(prop.model.proposal, top_pro, top_con)
        proposals.push(proposal)

    @add proposals
    ConsiderIt.all_proposals.add proposals if ConsiderIt.all_proposals != @
    # Watchout! sometimes the collection won't keep the same proposal model, so ConsiderIt.all_proposals might be out of sync with @collection

  add_proposal : (proposal_data) ->  
{'fraction_non_alphanumeric': 0.14893617021276595, 'fraction_numerical': 0.0022010271460014674, 'mean_word_length': 3.560200668896321, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2137634', 'n_tokens_mistral': 850, 'n_tokens_neox': 812, 'n_words': 193}