<commit_before>def execute(command)
  command = command + " 2>&1"
  STDOUT.puts [ "**", "Exec:", command ].join " "
  result = system command
  STDOUT.puts [ "**", "Result:", result ].join " "
end

def handlersocket_plugin_installed?
  `mysql -e "SHOW PLUGINS" | grep handlersocket | wc -l`.chomp.to_i > 0
end

def clone_handler_socket
  execute "git clone https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL.git"
  execute "cd HandlerSocket-Plugin-for-MySQL"
end

def prepare_mysql_source
  execute "wget #{mysql_download_url}"
  execute "tar xvf #{mysql_filename}"
end

def make_handler_socket
  execute "./autogen.sh"
  execute "./configure --with-mysql-source=#{mysql_source} --with-mysql-bindir=#{mysql_bin}"
  execute "make"
  execute "make install"
end

def mysql_source
  dirname = File.basename mysql_filename, ".tar.gz"
  File.expand_path dirname
end

def mysql_download_url
  "http://downloads.mysql.com/archives/mysql-#{mysql_version.split(".")[0..1].join(".")}/#{mysql_filename}"
end

def mysql_filename
  "mysql-#{mysql_version}.tar.gz"
end

def mysql_version
  `mysql_config --version`.chomp
end

def mysql_bin
  File.dirname `which mysql`.chomp
end

if handlersocket_plugin_installed?
  STDOUT.puts "HandlerSocket-Plugin-for-MySQL already installed"
else
  clone_handler_socket
  prepare_mysql_source
  make_handler_socket
end
<commit_msg>debug code<commit_after>def execute(command)
  command = command + " 2>&1"
  STDOUT.puts [ "**", "Exec:", command ].join " "
  result = system command
  STDOUT.puts [ "**", "Result:", result ].join " "
end

def handlersocket_plugin_installed?
  `mysql -e "SHOW PLUGINS" | grep handlersocket | wc -l`.chomp.to_i > 0
end

def clone_handler_socket
  execute "git clone https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL.git"
  execute "cd HandlerSocket-Plugin-for-MySQL"
end

def prepare_mysql_source
  execute "wget #{mysql_download_url}"
  execute "tar xvf #{mysql_filename}"
end

def make_handler_socket
  execute "pwd"
  execute "ls -lah"

  execute "./autogen.sh"
  execute "./configure --with-mysql-source=#{mysql_source} --with-mysql-bindir=#{mysql_bin}"
  execute "make"
  execute "make install"
end

def mysql_source
  dirname = File.basename mysql_filename, ".tar.gz"
  File.expand_path dirname
end

def mysql_download_url
  "http://downloads.mysql.com/archives/mysql-#{mysql_version.split(".")[0..1].join(".")}/#{mysql_filename}"
end

def mysql_filename
  "mysql-#{mysql_version}.tar.gz"
end

def mysql_version
  `mysql_config --version`.chomp
end

def mysql_bin
  File.dirname `which mysql`.chomp
end

if handlersocket_plugin_installed?
  STDOUT.puts "HandlerSocket-Plugin-for-MySQL already installed"
else
  clone_handler_socket
  prepare_mysql_source
  make_handler_socket
end

{'fraction_non_alphanumeric': 0.1290909090909091, 'fraction_numerical': 0.0036363636363636364, 'mean_word_length': 4.648870636550308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '304383', 'n_tokens_mistral': 973, 'n_tokens_neox': 949, 'n_words': 210}