<commit_before># Copyright 2007 <NAME>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Wopen3 is a replacement for Open3.
#
# Unlike Open3, Wopen3 does not throw away the exit code of the executed (grandchild) process.
# Only a child process is spawned and the exit status is returned in $? as normal.
#
# Usage example:
#
#   result, errors = '', ''
#   Wopen3.popen3('svn', 'log') do |stdin, stdout, stderr|
#     threads = []
#     threads << Thread.new(stdout) do |out|
#       out.each { |line| result << line }
#     end
#     threads << Thread.new(stderr) do |err|
#       err.each { |line| errors << line }
#     end
#     threads.each { |thread| thread.join }      
#   end
#   status = $?.exitstatus<commit_msg>(Tongue-in-cheek) "modernization" of code example<commit_after># Copyright 2007-2008 <NAME>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Wopen3 is a replacement for Open3.
#
# Unlike Open3, Wopen3 does not throw away the exit code of the executed (grandchild) process.
# Only a child process is spawned and the exit status is returned in $? as normal.
#
# Usage example:
#
#   result, errors = '', ''
#   Wopen3.popen3('git', 'log') do |stdin, stdout, stderr|
#     threads = []
#     threads << Thread.new(stdout) do |out|
#       out.each { |line| result << line }
#     end
#     threads << Thread.new(stderr) do |err|
#       err.each { |line| errors << line }
#     end
#     threads.each { |thread| thread.join }      
#   end
#   status = $?.exitstatus
{'fraction_non_alphanumeric': 0.09958662157083803, 'fraction_numerical': 0.00977076287110109, 'mean_word_length': 3.4219269102990033, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '1247306', 'n_tokens_mistral': 775, 'n_tokens_neox': 756, 'n_words': 351}