<commit_before>import ProxyPreset from './proxy';
import TunnelPreset from './tunnel';
import StatsPreset from './stats';
import TrackerPreset from './tracker';
import ExpCompressPreset from './exp-compress';
import ExpBaseWithPaddingPreset from './exp-base-with-padding';
import ExpBaseAuthStreamPreset from './exp-base-auth-stream';
import SsBasePreset from './ss-base';
import SsStreamCipherPreset from './ss-stream-cipher';
import SsAeadCipherPreset from './ss-aead-cipher';
import AeadRandomCipherPreset from './aead-random-cipher';
import ObfsHttpPreset from './obfs-http';
import ObfsTls12TicketPreset from './obfs-tls1.2-ticket';
import ObfsRandomPaddingPreset from './obfs-random-padding';

const mapping = {
  'proxy': ProxyPreset,
  'tunnel': TunnelPreset,
  'stats': StatsPreset,
  'tracker': TrackerPreset,
  'exp-compress': ExpCompressPreset,
  'exp-base-with-padding': ExpBaseWithPaddingPreset,
  'exp-base-auth-stream': ExpBaseAuthStreamPreset,
  'ss-base': SsBasePreset,
  'ss-stream-cipher': SsStreamCipherPreset,
  'ss-aead-cipher': SsAeadCipherPreset,
  'aead-random-cipher': AeadRandomCipherPreset,
  'obfs-http': ObfsHttpPreset,
  'obfs-tls1.2-ticket': ObfsTls12TicketPreset,
  'obfs-random-padding': ObfsRandomPaddingPreset
};

const presets = Object.keys(mapping);

function getPresetClassByName(name) {
  const clazz = mapping[name];
  if (clazz === undefined) {
    throw Error(`cannot find preset: "${name}"`);
  }
  return clazz;
}

export {getPresetClassByName, presets};
<commit_msg>presets: export modules from defs.js<commit_after>import ProxyPreset from './proxy';
import TunnelPreset from './tunnel';
import StatsPreset from './stats';
import TrackerPreset from './tracker';
import ExpCompressPreset from './exp-compress';
import ExpBaseWithPaddingPreset from './exp-base-with-padding';
import ExpBaseAuthStreamPreset from './exp-base-auth-stream';
import SsBasePreset from './ss-base';
import SsStreamCipherPreset from './ss-stream-cipher';
import SsAeadCipherPreset from './ss-aead-cipher';
import AeadRandomCipherPreset from './aead-random-cipher';
import ObfsHttpPreset from './obfs-http';
import ObfsTls12TicketPreset from './obfs-tls1.2-ticket';
import ObfsRandomPaddingPreset from './obfs-random-padding';

const mapping = {
  'proxy': ProxyPreset,
  'tunnel': TunnelPreset,
  'stats': StatsPreset,
  'tracker': TrackerPreset,
  'exp-compress': ExpCompressPreset,
  'exp-base-with-padding': ExpBaseWithPaddingPreset,
  'exp-base-auth-stream': ExpBaseAuthStreamPreset,
  'ss-base': SsBasePreset,
  'ss-stream-cipher': SsStreamCipherPreset,
  'ss-aead-cipher': SsAeadCipherPreset,
  'aead-random-cipher': AeadRandomCipherPreset,
  'obfs-http': ObfsHttpPreset,
  'obfs-tls1.2-ticket': ObfsTls12TicketPreset,
  'obfs-random-padding': ObfsRandomPaddingPreset
};

const presets = Object.keys(mapping);

function getPresetClassByName(name) {
  const clazz = mapping[name];
  if (clazz === undefined) {
    throw Error(`cannot find preset: "${name}"`);
  }
  return clazz;
}

export {getPresetClassByName, presets};
export * from './defs';

{'fraction_non_alphanumeric': 0.13797591929710382, 'fraction_numerical': 0.005206638464041653, 'mean_word_length': 5.512711864406779, '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': '6919461', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1073, 'n_words': 221}