<commit_before>function strategyGen(project_id: number) {
  return {
    match: /\$\{((?:[a-zA-Z_][a-zA-Z0-9_]*)?)$/,

    search: function (term: string, callback: Function) {
      $.ajax({
        url: '/project_parameters.json',
        method: 'GET',
        data: {
          project_id: project_id,
        }
      }).then((params: Array<any>) => {
        const p = params
          .map(pa => pa.key)
          .filter(k => k.indexOf(term) === 0);
        callback(p);
      });
    },

    template: function (value: string) {
      return '${' + value + '}';
    },
    replace: function (word: string) {
      return "${" + word + '}';
    },
    index: 1,
  };
}

export default strategyGen;<commit_msg>Fast request<commit_after>function strategyGen(project_id: number) {
  const ajax = $.ajax({
    url: '/project_parameters.json',
    method: 'GET',
    data: {
      project_id: project_id,
    }
  });

  return {
    match: /\$\{((?:[a-zA-Z_][a-zA-Z0-9_]*)?)$/,

    search: function (term: string, callback: Function) {
      ajax.then((params: Array<any>) => {
        const p = params
          .map(pa => pa.key)
          .filter(k => k.indexOf(term) === 0);
        callback(p);
      });
    },

    template: function (value: string) {
      return '${' + value + '}';
    },

    replace: function (word: string) {
      return "${" + word + '}';
    },
    index: 1,
  };
}

export default strategyGen;
{'fraction_non_alphanumeric': 0.1958041958041958, 'fraction_numerical': 0.005594405594405594, 'mean_word_length': 2.0974025974025974, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5313693', 'n_tokens_mistral': 501, 'n_tokens_neox': 481, 'n_words': 98}