<commit_before>import qiniu from 'qiniu';
import Promise from 'promise';
import { join } from 'path';

class QiniuPlugin {

  constructor(options) {
    this.options = Object.assign({}, options);
    qiniu.conf.ACCESS_KEY = this.options.ACCESS_KEY;
    qiniu.conf.SECRET_KEY = this.options.SECRET_KEY;
  }

  apply(compiler) {
    compiler.plugin('after-emit', (compilation, callback) => {
      const assets = compilation.assets;
      const hash = compilation.hash;
      const {
        bucket,
        include,
      } = this.options;
      let {
        path = '[hash]',<commit_msg>throw error if options is not provided<commit_after>import qiniu from 'qiniu';
import Promise from 'promise';
import { join } from 'path';

class QiniuPlugin {

  constructor(options) {
    if (!options || !options.ACCESS_KEY || !options.SECRET_KEY) {
      throw new Error('ACCESS_KEY and SECRET_KEY must be provided');
    }
    this.options = Object.assign({}, options);
    qiniu.conf.ACCESS_KEY = this.options.ACCESS_KEY;
    qiniu.conf.SECRET_KEY = this.options.SECRET_KEY;
  }

  apply(compiler) {
    compiler.plugin('after-emit', (compilation, callback) => {
      const assets = compilation.assets;
      const hash = compilation.hash;
      const {
        bucket,
        include,
      } = this.options;
      let {
        path = '[hash]',
{'fraction_non_alphanumeric': 0.1253731343283582, 'fraction_numerical': 0.0, 'mean_word_length': 2.9557522123893807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7014169', 'n_tokens_mistral': 426, 'n_tokens_neox': 421, 'n_words': 95}