<commit_before># is_null() checks if the variable chosen is empty
function is_null(arg::Any)
  arg = replace(arg, " ", "") # Delete space
  return arg == "" || arg == 0 ? true : false
end

# loadModule() load a module
function loadModule(moduleName::ASCIIString)
  moduleName = lowercase(moduleName)
  moduleName = ucfirst(moduleName)
  include("modules/" * moduleName * "Module.jl")
end

# Converts req.data to Dictionnary
function reqToDict(data)
  global dataPost = Dict()
  key = ""
  value = ""
  word = "key"
  for n in eachindex(data)
    char = Char(data[n])
    if char == '='
      word = "value"
    elseif char == '&'
      dataPost[key] = value
      word = "key"
      value = ""
      key = ""
    else
      if word == "key"
        key = string(key, char)
      else
        value = string(value, char)
      end
    end
  end
  if key != "" && value != ""
    dataPost[key] = value
  end
  return dataPost
end<commit_msg>Added getHeaders(contentType) function<commit_after># is_null() checks if the variable chosen is empty
function is_null(arg::Any)
  arg = replace(arg, " ", "") # Delete space
  return arg == "" || arg == 0 ? true : false
end

# loadModule() load a module
function loadModule(moduleName::ASCIIString)
  moduleName = lowercase(moduleName)
  moduleName = ucfirst(moduleName)
  include("modules/" * moduleName * "Module.jl")
end

# Converts req.data to Dictionnary
function reqToDict(data)
  global dataPost = Dict()
  key = ""
  value = ""
  word = "key"
  for n in eachindex(data)
    char = Char(data[n])
    if char == '='
      word = "value"
    elseif char == '&'
      dataPost[key] = value
      word = "key"
      value = ""
      key = ""
    else
      if word == "key"
        key = string(key, char)
      else
        value = string(value, char)
      end
    end
  end
  if key != "" && value != ""
    dataPost[key] = value
  end
  return dataPost
end

# Get headers
function getHeaders(contentType)
  return Headers(
  "Server"            => "Julia/$VERSION",
  "Content-Type"      => "text/$contentType; charset=utf-8",
  "Content-Language"  => "fr",
  "Date"              => Dates.format(now(Dates.UTC), Dates.RFC1123Format) )
end
{'fraction_non_alphanumeric': 0.1377574370709382, 'fraction_numerical': 0.003203661327231121, 'mean_word_length': 2.7495711835334475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '470426', 'n_tokens_mistral': 728, 'n_tokens_neox': 719, 'n_words': 198}