<commit_before># ReCAPTCHA
module Ambethia
  module ReCaptcha
    RECAPTCHA_API_SERVER        = 'http://api.recaptcha.net';
    RECAPTCHA_API_SECURE_SERVER = 'https://api-secure.recaptcha.net';
    RECAPTCHA_VERIFY_SERVER     = 'api-verify.recaptcha.net';

    SKIP_VERIFY_ENV = ['test']

    module Helper 
      # Your public API can be specified in the +options+ hash or preferably the environment
      # variable +RECAPTCHA_PUBLIC_KEY+.
      def recaptcha_tags(options = {})
        # Default options
        key   = options[:public_key] ||= ENV['RECAPTCHA_PUBLIC_KEY']
        error = options[:error] ||= session[:recaptcha_error]
        uri   = options[:ssl] ? RECAPTCHA_API_SECURE_SERVER : RECAPTCHA_API_SERVER
        xhtml = Builder::XmlMarkup.new :target => out=(''), :indent => 2 # Because I can.
        if options[:display] 
          xhtml.script(:type => "text/javascript"){ xhtml.text! "var RecaptchaOptions = #{options[:display].to_json};\n"}
        end
        if options[:ajax]
         xhtml.div(:id => 'dynamic_recaptcha') {}
         xhtml.script(:type => "text/javascript", :src => "#{uri}/js/recaptcha_ajax.js") {}
         xhtml.script(:type => "text/javascript") do
           xhtml.text! "Recaptcha.create('#{key}', document.getElementById('dynamic_recaptcha') );"
         end
        else
          xhtml.script(:type => "text/javascript", :src => "#{uri}/challenge?k=#{key}&error=#{error}") {}
          unless options[:noscript] == false
            xhtml.noscript do
              xhtml.iframe(:src => "#{uri}/noscript?k=#{key}",
                           :height => options[:iframe_height] ||= 300,<commit_msg>Use xhtml.script(:src => :symbol) not to escape the ampersand in '&error=...'<commit_after># ReCAPTCHA
module Ambethia
  module ReCaptcha
    RECAPTCHA_API_SERVER        = 'http://api.recaptcha.net';
    RECAPTCHA_API_SECURE_SERVER = 'https://api-secure.recaptcha.net';
    RECAPTCHA_VERIFY_SERVER     = 'api-verify.recaptcha.net';

    SKIP_VERIFY_ENV = ['test']

    module Helper 
      # Your public API can be specified in the +options+ hash or preferably the environment
      # variable +RECAPTCHA_PUBLIC_KEY+.
      def recaptcha_tags(options = {})
        # Default options
        key   = options[:public_key] ||= ENV['RECAPTCHA_PUBLIC_KEY']
        error = options[:error] ||= session[:recaptcha_error]
        uri   = options[:ssl] ? RECAPTCHA_API_SECURE_SERVER : RECAPTCHA_API_SERVER
        xhtml = Builder::XmlMarkup.new :target => out=(''), :indent => 2 # Because I can.
        if options[:display] 
          xhtml.script(:type => "text/javascript"){ xhtml.text! "var RecaptchaOptions = #{options[:display].to_json};\n"}
        end
        if options[:ajax]
         xhtml.div(:id => 'dynamic_recaptcha') {}
         xhtml.script(:type => "text/javascript", :src => "#{uri}/js/recaptcha_ajax.js") {}
         xhtml.script(:type => "text/javascript") do
           xhtml.text! "Recaptcha.create('#{key}', document.getElementById('dynamic_recaptcha') );"
         end
        else
          xhtml.script(:type => "text/javascript", :src => :"#{uri}/challenge?k=#{key}&error=#{error}") {}
          unless options[:noscript] == false
            xhtml.noscript do
              xhtml.iframe(:src => "#{uri}/noscript?k=#{key}",
                           :height => options[:iframe_height] ||= 300,
{'fraction_non_alphanumeric': 0.15263314489735197, 'fraction_numerical': 0.0023802439750074383, 'mean_word_length': 2.8688147295742232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 26, 'https://': 2, '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': '459038', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1033, 'n_words': 196}