<commit_before>const Joi = require('joi');
Joi.objectId = require('joi-objectid')(Joi);

const { challengeTypes } = require('../../client/utils/challengeTypes');

const fileJoi = Joi.object().keys({
  key: Joi.string(),
  ext: Joi.string(),
  name: Joi.string(),
  head: [Joi.array().items(Joi.string().allow('')), Joi.string().allow('')],
  tail: [Joi.array().items(Joi.string().allow('')), Joi.string().allow('')],
  contents: [Joi.array().items(Joi.string().allow('')), Joi.string().allow('')],
  editableRegionBoundaries: [Joi.array().items(Joi.string().allow(''))]
});

function getSchemaForLang(lang) {
  let schema = Joi.object().keys({
    block: Joi.string(),
    blockId: Joi.objectId(),
    challengeOrder: Joi.number(),
    challengeType: Joi.number()
      .min(0)
      .max(11)
      .required(),<commit_msg>fix: accept numbers for boundaries (#39181)<commit_after>const Joi = require('joi');
Joi.objectId = require('joi-objectid')(Joi);

const { challengeTypes } = require('../../client/utils/challengeTypes');

const fileJoi = Joi.object().keys({
  key: Joi.string(),
  ext: Joi.string(),
  name: Joi.string(),
  head: [Joi.array().items(Joi.string().allow('')), Joi.string().allow('')],
  tail: [Joi.array().items(Joi.string().allow('')), Joi.string().allow('')],
  contents: [Joi.array().items(Joi.string().allow('')), Joi.string().allow('')],
  editableRegionBoundaries: [Joi.array().items(Joi.number())]
});

function getSchemaForLang(lang) {
  let schema = Joi.object().keys({
    block: Joi.string(),
    blockId: Joi.objectId(),
    challengeOrder: Joi.number(),
    challengeType: Joi.number()
      .min(0)
      .max(11)
      .required(),
{'fraction_non_alphanumeric': 0.23589435774309725, 'fraction_numerical': 0.006602641056422569, 'mean_word_length': 4.429967426710098, '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': '7642228', 'n_tokens_mistral': 605, 'n_tokens_neox': 593, 'n_words': 92}