<commit_before>### define
underscore : _
backbone : backbone
###

class CommentsCollection extends Backbone.Collection


  intitalize : ->

    @coefficient = 1

  comparator : (model) ->

    return model.get("node") * @coefficient


  sort : (isAscending) ->

    @coefficient = if isAscending then 1 else -1
    super()<commit_msg>added filter for comments by id in comments collection #347<commit_after>### define
underscore : _
backbone : backbone
###

class CommentsCollection extends Backbone.Collection


  intitalize : ->

    @coefficient = 1


  comparator : (model) ->

    return model.get("node") * @coefficient


  sort : (isAscending) ->

    @coefficient = if isAscending then 1 else -1
    super()


  findCommentByNodeId : (id) ->

    return @findWhere({ node: id })


  hasCommentWithNodeId : (id) ->

    return @findCommentByNodeId(id) != undefined
{'fraction_non_alphanumeric': 0.1148105625717566, 'fraction_numerical': 0.010332950631458095, 'mean_word_length': 3.36, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '984079', 'n_tokens_mistral': 291, 'n_tokens_neox': 255, 'n_words': 73}