<commit_before>module Analytics
  module Rails
    module Extensions
      module ActionView
        module Base

          def google_analytics_include_tag(*args)
            if ::Rails.env.production?
              options = args.extract_options!
              id = args.first
              variables = options.to_json
              content_tag :script, <<-SCRIPT.html_safe, type: 'text/javascript'
                (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                })(window,document,"script","https://www.google-analytics.com/analytics.js","ga");
                ga("create", "#{id}", "auto");
                ga("send", "pageview", #{variables});
              SCRIPT
            end
          end

          def google_analytics_event_tag(*args)
            if ::Rails.env.production?
              options = args.extract_options!
              args = args.map(&:to_json).join(', ')
              variables = options.to_json
              content_tag :script, <<-SCRIPT.html_safe, type: 'text/javascript'
                ga("send", "event", #{args}, #{variables});
              SCRIPT
            end
          end

        end
      end
    end
  end
end<commit_msg>Improve code output<commit_after>module Analytics
  module Rails
    module Extensions
      module ActionView
        module Base

          def google_analytics_include_tag(*args)
            if ::Rails.env.production?
              options = args.extract_options!
              id = args.first
              variables = options.to_json
              content_tag :script, <<-SCRIPT.strip_heredoc.html_safe, type: 'text/javascript'
                (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                })(window,document,"script","https://www.google-analytics.com/analytics.js","ga");
                ga("create", "#{id}", "auto");
                ga("send", "pageview", #{variables});
              SCRIPT
            end
          end

          def google_analytics_event_tag(*args)
            if ::Rails.env.production?
              options = args.extract_options!
              args = args.map(&:to_json).join(', ')
              variables = options.to_json
              content_tag :script, <<-SCRIPT.strip_heredoc.html_safe, type: 'text/javascript'
                ga("send", "event", #{args}, #{variables});
              SCRIPT
            end
          end

        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1446629213483146, 'fraction_numerical': 0.002106741573033708, 'mean_word_length': 1.8982706002034588, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7583564', 'n_tokens_mistral': 873, 'n_tokens_neox': 833, 'n_words': 133}