<commit_before>MYAPP = "change path depending on your environment"

SBMETA = "change path depending on your environment"
DOCKER_OPTIONS = "-it"
VOLUME = "-v #{SBMETA}:/sbMeta"
IMAGE = "sbmeta"
SCRIPT_DIR = "/sbMeta/script"
DATA_DIR = "/sbMeta/data"

namespace :umakadata do

  desc "Create relations between endpoints for all endpoints"
  task :create_relations_csv_for_all_endpoints => :environment do |task, args|
    all_prefixes_file = "#{SBMETA}/data/all_prefixes.csv"
    Rake::Task["umakadata:export_prefixes"].execute(Rake::TaskArguments.new([:output_path], [all_prefixes_file]))
    Endpoint.pluck(:name).each do |name|
      Rake::Task["sbmeta:create_relations_csv"].execute(Rake::TaskArguments.new([:name, :id], [name]))
    end
  end

  desc "Create relations between endpoints for an endpoint"
  task :create_relations_csv, ['name'] => :environment do |task, args|
    directory_path = "#{SBMETA}/data/bulkdownloads/#{args[:name]}/downloads"
    endpoint = Endpoint.where(:name => args[:name]).take<commit_msg>fix the bug of namespace<commit_after>MYAPP = "change path depending on your environment"

SBMETA = "change path depending on your environment"
DOCKER_OPTIONS = "-it"
VOLUME = "-v #{SBMETA}:/sbMeta"
IMAGE = "sbmeta"
SCRIPT_DIR = "/sbMeta/script"
DATA_DIR = "/sbMeta/data"

namespace :umakadata do

  desc "Create relations between endpoints for all endpoints"
  task :create_relations_csv_for_all_endpoints => :environment do |task, args|
    all_prefixes_file = "#{SBMETA}/data/all_prefixes.csv"
    Rake::Task["umakadata:export_prefixes"].execute(Rake::TaskArguments.new([:output_path], [all_prefixes_file]))
    Endpoint.pluck(:name).each do |name|
      Rake::Task["umakadata:create_relations_csv"].execute(Rake::TaskArguments.new([:name, :id], [name]))
    end
  end

  desc "Create relations between endpoints for an endpoint"
  task :create_relations_csv, ['name'] => :environment do |task, args|
    directory_path = "#{SBMETA}/data/bulkdownloads/#{args[:name]}/downloads"
    endpoint = Endpoint.where(:name => args[:name]).take
{'fraction_non_alphanumeric': 0.141747572815534, 'fraction_numerical': 0.0, 'mean_word_length': 5.669902912621359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986284', 'n_tokens_mistral': 688, 'n_tokens_neox': 678, 'n_words': 151}