<commit_before>require 'shellwords'
require 'open3'

module Backend
  class TransactionsController < ApplicationController
    skip_before_filter :verify_authenticity_token, :only => [:verify]

    def verify
      #{"creations"=>nil, "inputs"=>[{"signature"=>"5fRnXJUWBE3TtiWjDNjD2se3QXrX9D9yxKoxSbagUWwcjMFWAWa39iHPKZD2t3dfbaGSk4yt1JqVAcd37t55QPXpC3bNb4dU8toEFPUE 3Q4aB3XMvzGpj27JNk31cWaTVMp82YokPdXYZeYu3YdxzJU4aisesNHUuT2waDCpjUPwko7ruEQQ75zcRHHyEQ8PhcVFWm", "outputId"=>7, "inputId"=>0}], "outputs"=>[{"address"=>"1Kau4L6BM1h6QzLYubq1qWrQSjWdZFQgMb", "creatorAddress"=>"138u97o2Sv5qUmucSasmeNf5CAb3B1CmD6", "outputId"=>0, "inputId"=>0, "amount"=>1}], "transactionId"=>0, "transaction"=>{}}
      transaction = params[:transaction]

      unless transaction.class.eql?(String)<commit_msg>Handle nil instead of empty array<commit_after>require 'shellwords'
require 'open3'

module Backend
  class TransactionsController < ApplicationController
    skip_before_filter :verify_authenticity_token, :only => [:verify]

    def verify
      #{"creations"=>nil, "inputs"=>[{"signature"=>"5fRnXJUWBE3TtiWjDNjD2se3QXrX9D9yxKoxSbagUWwcjMFWAWa39iHPKZD2t3dfbaGSk4yt1JqVAcd37t55QPXpC3bNb4dU8toEFPUE 3Q4aB3XMvzGpj27JNk31cWaTVMp82YokPdXYZeYu3YdxzJU4aisesNHUuT2waDCpjUPwko7ruEQQ75zcRHHyEQ8PhcVFWm", "outputId"=>7, "inputId"=>0}], "outputs"=>[{"address"=>"1Kau4L6BM1h6QzLYubq1qWrQSjWdZFQgMb", "creatorAddress"=>"138u97o2Sv5qUmucSasmeNf5CAb3B1CmD6", "outputId"=>0, "inputId"=>0, "amount"=>1}], "transactionId"=>0, "transaction"=>{}}
      transaction = params[:transaction]

      unless transaction.class.eql?(String)
        transaction["creations"]=[] if transaction["creations"].nil? # WOW, such ugly # TODO Patrick should never send nil
{'fraction_non_alphanumeric': 0.13202084539664158, 'fraction_numerical': 0.06832657788071801, 'mean_word_length': 9.732919254658386, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6269387', 'n_tokens_mistral': 817, 'n_tokens_neox': 762, 'n_words': 78}