<commit_before># encoding utf-8

class Carto::StorageOptions::Local
  UPLOADS_DIRECTORY = "public/uploads".freeze

  def upload(namespaced_name, file)
    FileUtils.mkdir_p(UPLOADS_DIRECTORY)

    target_full_path = File.join(UPLOADS_DIRECTORY, namespaced_name)
    FileUtils.mkdir_p(target_full_path)
    FileUtils.mv(file.path, target_full_path)

    "http://#{CartoDB.account_host}/#{target_full_path}"
  end

  def remove(namespaced_name)
    File.delete(namespaced_name) if File.exist?(namespaced_name)
  end
end<commit_msg>parametrizable protocol<commit_after># encoding utf-8

class Carto::StorageOptions::Local
  UPLOADS_DIRECTORY = "public/uploads".freeze

  def upload(namespaced_name, file, protocol: 'https')
    FileUtils.mkdir_p(UPLOADS_DIRECTORY)

    target_full_path = File.join(UPLOADS_DIRECTORY, namespaced_name)
    FileUtils.mkdir_p(target_full_path)
    FileUtils.mv(file.path, target_full_path)

    "#{protocol}://#{CartoDB.account_host}/#{target_full_path}"
  end

  def remove(namespaced_name)
    File.delete(namespaced_name) if File.exist?(namespaced_name)
  end
end
{'fraction_non_alphanumeric': 0.10694698354661791, 'fraction_numerical': 0.0018281535648994515, 'mean_word_length': 5.676829268292683, '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': '4021381', 'n_tokens_mistral': 402, 'n_tokens_neox': 390, 'n_words': 54}