<commit_before>// @flow
import 'babel-polyfill';

import kafka from 'no-kafka';
import NULL_LOGGER from 'null-logger';
import Task from './task';
import Registry from './registry';
import Runner from './runner';
import Admin from './admin';
import Producer from './producer';
import Config from './config';

import type { Callback, Configuration } from '../types';

const Steveo = (config: Configuration, logger: Object = NULL_LOGGER) => () => {
  const registry = Registry();
  config = new Config(config);
  let getTopicName = null;

  const task = (topic: string, callBack: Callback) => {
    const producer = Producer(config, registry, logger);
    let topicName = topic;
    if (getTopicName && typeof getTopicName === 'function') {
      topicName = getTopicName(topic);
    }
    return Task(config, registry, producer, topicName, callBack);
  };

  const customTopicName = (cb: Callback) => {
    getTopicName = cb;
  };

  const runner = () => Runner(config, registry, logger);<commit_msg>rename config<commit_after>// @flow
import 'babel-polyfill';

import kafka from 'no-kafka';
import NULL_LOGGER from 'null-logger';
import Task from './task';
import Registry from './registry';
import Runner from './runner';
import Admin from './admin';
import Producer from './producer';
import Config from './config';

import type { Callback, Configuration } from '../types';

const Steveo = (configuration: Configuration, logger: Object = NULL_LOGGER) => () => {
  const registry = Registry();
  const config = new Config(configuration);
  let getTopicName = null;

  const task = (topic: string, callBack: Callback) => {
    const producer = Producer(config, registry, logger);
    let topicName = topic;
    if (getTopicName && typeof getTopicName === 'function') {
      topicName = getTopicName(topic);
    }
    return Task(config, registry, producer, topicName, callBack);
  };

  const customTopicName = (cb: Callback) => {
    getTopicName = cb;
  };

  const runner = () => Runner(config, registry, logger);
{'fraction_non_alphanumeric': 0.14186507936507936, 'fraction_numerical': 0.0, 'mean_word_length': 4.080604534005038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4064667', 'n_tokens_mistral': 583, 'n_tokens_neox': 575, 'n_words': 193}