<commit_before>
require 'digest/sha1'
require 'make_time_helper.rb'
require 'Locking'
require 'Files'

class Dojo
  
  include Locking
  extend Locking  
  include MakeTimeHelper
  extend MakeTimeHelper
  include Files
  extend Files
  
  Index_filename = 'index.rb' 

  def self.find(params)
    name = params[:dojo_name]
    root_folder = params[:dojo_root]    
    inner = root_folder + '/' + Dojo::inner_folder(name)
    outer = inner + '/' + Dojo::outer_folder(name)
    File.directory? inner and File.directory? outer
  end

  def self.create(params)
    name = params[:dojo_name]
    root_folder = params[:dojo_root]    
    inner = root_folder + '/' + Dojo::inner_folder(name)
    outer = inner + '/' + Dojo::outer_folder(name)
    
    io_lock(root_folder) do
      if File.directory? inner and File.directory? outer
        false
      else
        make_dir(inner)
        make_dir(outer)
        true
      end
    end
  end
  <commit_msg>create "dojos"-rootfolder, if it does not exist<commit_after>
require 'digest/sha1'
require 'make_time_helper.rb'
require 'Locking'
require 'Files'

class Dojo
  
  include Locking
  extend Locking  
  include MakeTimeHelper
  extend MakeTimeHelper
  include Files
  extend Files
  
  Index_filename = 'index.rb' 

  def self.find(params)
    name = params[:dojo_name]
    root_folder = params[:dojo_root]    
    inner = root_folder + '/' + Dojo::inner_folder(name)
    outer = inner + '/' + Dojo::outer_folder(name)
    File.directory? inner and File.directory? outer
  end

  def self.create(params)
    name = params[:dojo_name]
    root_folder = params[:dojo_root]    
    inner = root_folder + '/' + Dojo::inner_folder(name)
    outer = inner + '/' + Dojo::outer_folder(name)
    
    if !File.directory? root_folder
      make_dir(root_folder)
    end

    io_lock(root_folder) do
      if File.directory? inner and File.directory? outer
        false
      else
        make_dir(inner)
        make_dir(outer)
        true
      end
    end
  end
  
{'fraction_non_alphanumeric': 0.09715994020926756, 'fraction_numerical': 0.000996512207274539, 'mean_word_length': 2.8247619047619046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4848162', 'n_tokens_mistral': 671, 'n_tokens_neox': 660, 'n_words': 153}