<commit_before>module ForecastIo
  module ImgForecasts
    include Magick
    def img_rain_forecast(forecast)
      if forecast['minutely'].nil?
        return 'No minute-by-minute data available.'
      end

      area = {x: 600, y: 350}
      graph_area = {x: 600, y: 300}
      data = forecast['minutely']['data']

      RVG::dpi = 72

      points = percip_chance_to_points(data, graph_area, 0, 1)

      rvg = RVG.new(area[:x].px, area[:y].px).viewbox(0,0,area[:x],area[:y]) do |canvas|
        canvas.background_fill = 'white'

        rain = RVG::Group.new do |_rain|
          _rain.path(points).styles(:stroke_width=>1, :fill=>'blue', :stroke=>'grey')
        end

        binding.pry
        canvas.use(rain).translate(0,(area[:y] - graph_area[:y]))
      end

      rvg.draw.write('rain.gif')

    end

    def duck_you(duck_subject)

       RVG::dpi = 72

       rvg = RVG.new(2.5.in, 2.5.in).viewbox(0,0,250,250) do |canvas|
           canvas.background_fill = 'white'

           canvas.g.translate(100, 150).rotate(-30) do |body|
              body.styles(:fill=>'yellow', :stroke=>'black', :stroke_width=>2)
              body.ellipse(50, 30)
              body.rect(45, 20, -20, -10).skewX(-35)
          end

          canvas.g.translate(130, 83) do |head|
              head.styles(:stroke=>'black', :stroke_width=>2)
              head.circle(30).styles(:fill=>'yellow')
              head.circle(5, 10, -5).styles(:fill=>'black')
              head.polygon(30,0, 70,5, 30,10, 62,25, 23,20).styles(:fill=>'orange')
          end

          foot = RVG::Group.new do |_foot|
              _foot.path('m0,0 v30 l30,10 l5,-10, l-5,-10 l-30,10z').
                    styles(:stroke_width=>2, :fill=>'orange', :stroke=>'black')<commit_msg>rm bp<commit_after>module ForecastIo
  module ImgForecasts
    include Magick
    def img_rain_forecast(forecast)
      if forecast['minutely'].nil?
        return 'No minute-by-minute data available.'
      end

      area = {x: 600, y: 350}
      graph_area = {x: 600, y: 300}
      data = forecast['minutely']['data']

      RVG::dpi = 72

      points = percip_chance_to_points(data, graph_area, 0, 1)

      rvg = RVG.new(area[:x].px, area[:y].px).viewbox(0,0,area[:x],area[:y]) do |canvas|
        canvas.background_fill = 'white'

        rain = RVG::Group.new do |_rain|
          _rain.path(points).styles(:stroke_width=>1, :fill=>'blue', :stroke=>'grey')
        end

        canvas.use(rain).translate(0,(area[:y] - graph_area[:y]))
      end

      rvg.draw.write('rain.gif')

    end

    def duck_you(duck_subject)

       RVG::dpi = 72

       rvg = RVG.new(2.5.in, 2.5.in).viewbox(0,0,250,250) do |canvas|
           canvas.background_fill = 'white'

           canvas.g.translate(100, 150).rotate(-30) do |body|
              body.styles(:fill=>'yellow', :stroke=>'black', :stroke_width=>2)
              body.ellipse(50, 30)
              body.rect(45, 20, -20, -10).skewX(-35)
          end

          canvas.g.translate(130, 83) do |head|
              head.styles(:stroke=>'black', :stroke_width=>2)
              head.circle(30).styles(:fill=>'yellow')
              head.circle(5, 10, -5).styles(:fill=>'black')
              head.polygon(30,0, 70,5, 30,10, 62,25, 23,20).styles(:fill=>'orange')
          end

          foot = RVG::Group.new do |_foot|
              _foot.path('m0,0 v30 l30,10 l5,-10, l-5,-10 l-30,10z').
                    styles(:stroke_width=>2, :fill=>'orange', :stroke=>'black')
{'fraction_non_alphanumeric': 0.17327586206896553, 'fraction_numerical': 0.06091954022988506, 'mean_word_length': 2.2839622641509436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, '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': '3203711', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1213, 'n_words': 219}