<commit_before>module DublinBikes
  class Marker
    include HappyMapper
    tag 'marker'
    attribute :name, String
    attribute :number, Integer
    attribute :address, String
    attribute :full_address, String, tag: 'fullAddress'
    attribute :lat, Float
    attribute :lng, Float
    attribute :open, Integer
    attribute :bonus, Integer

    remove_method :open, :bonus, :full_address

    def open?
      @open == 1
    end

    def closed?
      !open
    end

    def distance_to(m_lat, m_lng)
      d_lat = (@lat - m_lat).to_rad
      d_lng = (@lng - m_lng).to_rad

      a = Math.sin(d_lat / 2) * Math.sin(d_lat / 2) +
        Math.cos(m_lat.to_rad) * Math.cos(@lat.to_rad) *
        Math.sin(d_lng / 2) * Math.sin(d_lng / 2)

      c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))

      6371 * c
    end
  end
end

class Numeric
  def to_rad
    self * Math::PI / 180
  end
end
<commit_msg>Make tests green<commit_after>module DublinBikes
  class Marker
    include HappyMapper
    tag 'marker'
    attribute :name, String
    attribute :number, Integer
    attribute :address, String
    attribute :full_address, String, tag: 'fullAddress'
    attribute :lat, Float
    attribute :lng, Float
    attribute :open, Integer
    attribute :bonus, Integer

    remove_method :open, :bonus, :full_address

    def open?
      @open == 1
    end

    def closed?
      !open?
    end

    def distance_to(m_lat, m_lng)
      d_lat = (@lat - m_lat).to_rad
      d_lng = (@lng - m_lng).to_rad

      a = Math.sin(d_lat / 2) * Math.sin(d_lat / 2) +
        Math.cos(m_lat.to_rad) * Math.cos(@lat.to_rad) *
        Math.sin(d_lng / 2) * Math.sin(d_lng / 2)

      c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))

      6371 * c
    end
  end
end

class Numeric
  def to_rad
    self * Math::PI / 180
  end
end

{'fraction_non_alphanumeric': 0.11031833150384193, 'fraction_numerical': 0.01646542261251372, 'mean_word_length': 2.308529945553539, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2329886', 'n_tokens_mistral': 700, 'n_tokens_neox': 663, 'n_words': 174}