<commit_before>module MapHelper
  DEFAULT_CENTER = [45.523037,-122.667637]
  DEFAULT_ZOOM = 11
  COLORS = ['red', 'blue', 'orange', 'yellow', 'black', 'brown', 'green']

  # Return markup containing a Google map with markers for these Locations, 
  # or a default map if no locations are present. "locations" can be one 
  # item or an array of them.
  #
  # The plugin uses Google Maps automatic zooming to set the scale, but
  # the little overview map obscures such a big chunk of the main map that
  # it's likely to hide some of our markers, so it's off by default.
  def google_map(locations, options={})
    return nil if defined?(GoogleMap::GOOGLE_APPLICATION_ID) == nil
    height = options.delete(:height)
    width = options.delete(:width)
    partial = options.delete(:partial)
    options[:controls] ||= [:zoom, :scale, :type] # the default, minus :overview

    locations = [locations].flatten.select { |location| location.valid_location? }
    if locations.empty?
      options[:center] = DEFAULT_CENTER
      options[:zoom] = DEFAULT_ZOOM
    end

    # Make the map and our marker(s)
    map = GoogleMap.new(options)
    locations.each do |location|
      icon = GoogleMapSmallIcon.new(COLORS[location.user.id % COLORS.size])
      html = render(:partial => partial, :object => location) if partial
      map.markers << GoogleMapMarker.new(:map => map,
        :lat => location.latitude, :lng => location.longitude,
        :html => html, :icon => icon)
    end
    map.to_html + map.div(width, height)
  end
end
<commit_msg>reword this ruby for 1.9<commit_after>module MapHelper
  DEFAULT_CENTER = [45.523037,-122.667637]
  DEFAULT_ZOOM = 11
  COLORS = ['red', 'blue', 'orange', 'yellow', 'black', 'brown', 'green']

  # Return markup containing a Google map with markers for these Locations, 
  # or a default map if no locations are present. "locations" can be one 
  # item or an array of them.
  #
  # The plugin uses Google Maps automatic zooming to set the scale, but
  # the little overview map obscures such a big chunk of the main map that
  # it's likely to hide some of our markers, so it's off by default.
  def google_map(locations, options={})
    return nil unless defined?(GoogleMap::GOOGLE_APPLICATION_ID)
    height = options.delete(:height)
    width = options.delete(:width)
    partial = options.delete(:partial)
    options[:controls] ||= [:zoom, :scale, :type] # the default, minus :overview

    locations = [locations].flatten.select { |location| location.valid_location? }
    if locations.empty?
      options[:center] = DEFAULT_CENTER
      options[:zoom] = DEFAULT_ZOOM
    end

    # Make the map and our marker(s)
    map = GoogleMap.new(options)
    locations.each do |location|
      icon = GoogleMapSmallIcon.new(COLORS[location.user.id % COLORS.size])
      html = render(:partial => partial, :object => location) if partial
      map.markers << GoogleMapMarker.new(:map => map,
        :lat => location.latitude, :lng => location.longitude,
        :html => html, :icon => icon)
    end
    map.to_html + map.div(width, height)
  end
end

{'fraction_non_alphanumeric': 0.11545924967658473, 'fraction_numerical': 0.0129366106080207, 'mean_word_length': 3.508746355685131, 'pattern_counts': {'":': 0, '<': 7, '<?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': '324798', 'n_tokens_mistral': 988, 'n_tokens_neox': 919, 'n_words': 311}