<commit_before>function templ(strings, value) {
  const str0 = strings[0];
  const str1 = strings[1];
  if (Array.isArray(value)) {
    const o = value.map(x => x.value);
    const r = [];
    if (!value.length) {
      return '';
    }
    o.forEach((s) => {
      r.push(`${str0}${s}${str1}`);
    });
    return `AND (${r.join(' OR ')})`;
  }
  return `AND ${str0}${value.value}${str1}`;
}

function validate(p) {
  if (p !== null && p !== undefined && p.length > 0 && p[0] !== null && p[0] !== undefined) {
    return true;
  }
  return false;
}

const queryTemplate = (props) => {
  const {
    select,
    group,
    minPatch,
    maxPatch,
    hero,
    player,
    league,
    playerPurchased,
    minDuration,
    maxDuration,
    side,
    result,
    team,
    organization,
    laneRole,
    region,
    minDate,
    maxDate,
    order,
    tier,
    having,
    limit,
    isTi7Team,
  } = props;
  // array inputs
  // group
  // hero
  // player
  // league
  // team
  // organization
  let query;
  let groupArray = [];
  let selectArray = [];
  if (!(Array.isArray(group))) {
    groupArray.push(group);
  } else {
    groupArray = group;
  }
  if (!(Array.isArray(select))) {
    selectArray.push(select);
  } else {
    selectArray = select;
  }
  selectArray = selectArray.filter(x => x !== undefined);
  groupArray = groupArray.filter(x => x !== undefined);
  groupArray.forEach((x) => {
    if (x.json_each) {
      selectArray.push(x);
    }
  });
  selectArray.forEach((x, index) => {
    if (x && x.groupValue) {
      const a = {
        value: x.groupKey, groupKeySelect: x.groupKeySelect, alias: x.alias, key: `key${index.toString()}`,
      };
      if (x.groupKey === 'key') {<commit_msg>grouparray fix<commit_after>function templ(strings, value) {
  const str0 = strings[0];
  const str1 = strings[1];
  if (Array.isArray(value)) {
    const o = value.map(x => x.value);
    const r = [];
    if (!value.length) {
      return '';
    }
    o.forEach((s) => {
      r.push(`${str0}${s}${str1}`);
    });
    return `AND (${r.join(' OR ')})`;
  }
  return `AND ${str0}${value.value}${str1}`;
}

function validate(p) {
  if (p !== null && p !== undefined && p.length > 0 && p[0] !== null && p[0] !== undefined) {
    return true;
  }
  return false;
}

const queryTemplate = (props) => {
  const {
    select,
    group,
    minPatch,
    maxPatch,
    hero,
    player,
    league,
    playerPurchased,
    minDuration,
    maxDuration,
    side,
    result,
    team,
    organization,
    laneRole,
    region,
    minDate,
    maxDate,
    order,
    tier,
    having,
    limit,
    isTi7Team,
  } = props;
  // array inputs
  // group
  // hero
  // player
  // league
  // team
  // organization
  let query;
  let groupArray = [];
  let selectArray = [];
  if (!(Array.isArray(group))) {
    groupArray.push(group);
  } else {
    groupArray = group;
  }
  if (!(Array.isArray(select))) {
    selectArray.push(select);
  } else {
    selectArray = select;
  }
  selectArray = selectArray.filter(x => x !== undefined);
  groupArray = groupArray.filter(x => x !== undefined);
  groupArray.forEach((x) => {
    if (x.json_each) {
      selectArray.push(x);
    }
  });
  groupArray = groupArray.filter(x => !x.json_each);
  selectArray.forEach((x, index) => {
    if (x && x.groupValue) {
      const a = {
        value: x.groupKey, groupKeySelect: x.groupKeySelect, alias: x.alias, key: `key${index.toString()}`,
      };
      if (x.groupKey === 'key') {
{'fraction_non_alphanumeric': 0.17898052691867125, 'fraction_numerical': 0.006872852233676976, 'mean_word_length': 2.4211557296767876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '6258326', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1247, 'n_words': 264}