<commit_before>Darkswarm.factory "OfnMap", (Enterprises, EnterpriseListModal, MapConfiguration) ->
  new class OfnMap
    constructor: ->
      @coordinates = {}
      @enterprises = Enterprises.enterprises.filter (enterprise) ->
        # Remove enterprises w/o lat or long
        enterprise.latitude != null || enterprise.longitude != null
      @enterprises = @enterprise_markers(@enterprises)
      self = this

    enterprise_markers: (enterprises) ->
      @extend(enterprise) for enterprise in enterprises

    enterprise_hash: (hash, enterprise) ->
      hash[enterprise.id] = { id: enterprise.id, name: enterprise.name, icon: enterprise.icon_font }
      hash

    # Adding methods to each enterprise
    extend: (enterprise) ->
      marker = @coordinates[[enterprise.latitude, enterprise.longitude]]
      self = this
      if !marker
        marker.icon = MapConfiguration.options.cluster_icon
        self.enterprise_hash(marker.enterprises, enterprise)
        marker.id.push(enterprise.id)
      else
        marker = new class MapMarker
          # We cherry-pick attributes because GMaps tries to crawl
          # our data, and our data is cyclic, so it breaks
          latitude: enterprise.latitude
          longitude: enterprise.longitude
          icon: enterprise.icon
          id: [enterprise.id]
          enterprises: self.enterprise_hash({}, enterprise)
          reveal: =>
            EnterpriseListModal.open this.enterprises
        @coordinates[[enterprise.latitude, enterprise.longitude]] = marker
      marker<commit_msg>Missed out on inverting the boolean expression<commit_after>Darkswarm.factory "OfnMap", (Enterprises, EnterpriseListModal, MapConfiguration) ->
  new class OfnMap
    constructor: ->
      @coordinates = {}
      @enterprises = Enterprises.enterprises.filter (enterprise) ->
        # Remove enterprises w/o lat or long
        enterprise.latitude != null || enterprise.longitude != null
      @enterprises = @enterprise_markers(@enterprises)
      self = this

    enterprise_markers: (enterprises) ->
      @extend(enterprise) for enterprise in enterprises

    enterprise_hash: (hash, enterprise) ->
      hash[enterprise.id] = { id: enterprise.id, name: enterprise.name, icon: enterprise.icon_font }
      hash

    # Adding methods to each enterprise
    extend: (enterprise) ->
      marker = @coordinates[[enterprise.latitude, enterprise.longitude]]
      self = this
      if marker
        marker.icon = MapConfiguration.options.cluster_icon
        self.enterprise_hash(marker.enterprises, enterprise)
        marker.id.push(enterprise.id)
      else
        marker = new class MapMarker
          # We cherry-pick attributes because GMaps tries to crawl
          # our data, and our data is cyclic, so it breaks
          latitude: enterprise.latitude
          longitude: enterprise.longitude
          icon: enterprise.icon
          id: [enterprise.id]
          enterprises: self.enterprise_hash({}, enterprise)
          reveal: =>
            EnterpriseListModal.open this.enterprises
        @coordinates[[enterprise.latitude, enterprise.longitude]] = marker
      marker
{'fraction_non_alphanumeric': 0.08926302414231257, 'fraction_numerical': 0.0, 'mean_word_length': 2.789410348977136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '369314', 'n_tokens_mistral': 829, 'n_tokens_neox': 817, 'n_words': 215}