<commit_before>import React, { Component, Fragment } from "react";
import { connect }          from 'react-redux'
import { translate        } from "react-i18next";
import T                    from "prop-types";
import styled               from "styled-components";
import classNames            from "classnames";
import DatePicker from 'react-datepicker';
import { FontAwesomeIcon }  from '@fortawesome/react-fontawesome'
import { reduxForm, Field, initialize}       from "redux-form";

import update from 'immutability-helper'
import lodashGet from 'lodash/get'
import moment, {min} from 'moment'

import 'react-datepicker/dist/react-datepicker.min.css';
import en_GB from "date-fns/locale/en-GB";

import {pink} from './styling/Variables';
import Actions              from "../Actions";
import validation           from "../util/validation";
import NavButton            from "./pure/NavButton";
import { IDS, NAMES }       from "../constants/Categories";
import URLs                 from "../constants/URLs";
import LICENSES             from "../constants/Licenses";
import { EDIT             } from "../constants/Form";
import SelectTags           from './SelectTags';
import ScrollableDiv        from "./pure/ScrollableDiv";
import NavButtonWrapper     from "./pure/NavButtonWrapper";



const renderDatePickerStart = ({input, initEndDate, endDate, ...props}) => {
  const minDate = moment()
  const minTime = moment()

  const isDateSelected = !!input.value
  let selectedDate = new window.Date()
  if (isDateSelected) {
    selectedDate = moment(input.value > 99999999999 ? input.value : ((input.value + (new window.Date(input.value * 1000).getTimezoneOffset() * 60)) * 1000))
  }

  if (isDateSelected && selectedDate.isAfter(new window.Date(), 'day')) {
    minTime.set({hour: 0, minute: 0})
  }

  return (
    <DatePicker
      {...props}
      locale={en_GB}
      selected={isDateSelected ? selectedDate.toDate() : ''}
      showTimeSelect
      timeFormat="HH:mm"
      dateFormat="dd.MM.yyyy HH:mm"
      onChange={(day) => input.onChange(day)}
      minDate={minDate.toDate()}
      maxDate={endDate ? endDate : (initEndDate ? initEndDate : '')}
      minTime={minTime.toDate()}
      maxTime={moment().set({hour: 23, minute: 30}).toDate()}
    />
  )
}

const renderDatePickerEnd = ({ input, initStartDate, startDate,  ...props }) => {
  const hasStartDate = !!startDate
  let firstDate = moment()
  if (hasStartDate) {
    firstDate = moment(startDate)
  } else if(initStartDate) {
    firstDate = moment(initStartDate)
  }

  const isDateSelected = !!input.value
  let selectedDate = new window.Date()
  if (isDateSelected) {
    selectedDate = moment(input.value > 99999999999 ? input.value : ((input.value + (new window.Date(input.value * 1000).getTimezoneOffset() * 60)) * 1000))
  }

  let minDate = firstDate.clone()
  let minTime = moment()

  // show all times
  if (!hasStartDate && !isDateSelected) {
    minTime = moment(firstDate).clone().add(30, 'minutes')
  } else if (hasStartDate && !isDateSelected) {
    minTime = moment(firstDate).clone().add(30, 'minutes')
  } else if (hasStartDate && isDateSelected) {
    if(selectedDate.isSame(firstDate, 'day')){
      minTime = moment(firstDate).clone().add(30, 'minutes')
      if (selectedDate.isSameOrBefore(firstDate)) {
        selectedDate = firstDate.clone().add(30, 'minute')
        if (selectedDate.isAfter(firstDate, 'day')) {
          minDate.add(1, 'day')
        }
      }
    } else if (selectedDate.isBefore(firstDate, 'day')) {
      selectedDate = firstDate.clone().add(30, 'minute')
      minTime = moment(firstDate).clone().add(30, 'minutes')
    } else if (selectedDate.isAfter(firstDate, 'day')) {
      minTime.set({hour: 0, minutes: 0})
    }
  }

  return (
    <DatePicker
      {...props}
      locale={en_GB}
      selected={isDateSelected ? selectedDate.toDate() : ''}
      showTimeSelect
      timeFormat="HH:mm"
      dateFormat="dd.MM.yyyy HH:mm"
      onChange={(day) => input.onChange(day)}
      minDate={minDate.toDate()}
      minTime={minTime.toDate()}
      maxTime={firstDate.clone().hours(23).minutes(30).toDate()}
      popperPlacement="bottom-end"
    />
  );
};

function convertToDateForPicker(date) {
  const d = new window.Date(date);
  return `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`;
}

class Form extends Component {
  state = {
    isEventEntry: false,
    startDate: '',
    endDate: '',
    numberOfCustomLinks: 1,
  };

  componentDidMount() {
    this.setState({
      isEventEntry: this.props.category === IDS.EVENT,
      numberOfCustomLinks: this.props.numberOfCustomLinks || 1
    })

    this.props.dispatch(Actions.search(true))
  }

  componentWillUnmount() {
    this.props.dispatch(Actions.search(false))
  }

  handleCategoryChange = (event) => {
    const category = event.target.value;
    this.setState({ isEventEntry: category=== IDS.EVENT});
  };

  handleFromChange = (from) => {
    this.setState({ startDate: from });
  };

  handleToChange = (to) => {
    this.setState({ endDate: to });
  };
 

  render() {
    const { isEdit, isEvent, formStartEndDate, descriptionLength, license, dispatch, handleSubmit } = this.props;

    const {saveButtonCustomization, cancelButtonCustomization} = this.props;

    const { isEventEntry, startDate, endDate } = this.state;
    const initStartDate = formStartEndDate.startDate ? new window.Date(formStartEndDate.startDate) : '';
    const initEndDate = formStartEndDate.endDate ? new window.Date(formStartEndDate.endDate) : '';
    // TODO: use process.env.ENTRY_DESCRIPTION_WARN_LIMIT instead of hard code
    const isDescriptionTooLong = descriptionLength > 250

    const t = (key) => {
      return this.props.t("entryForm." + key);
    };

    return (
    <FormWrapper>
      <ScrollableDiv id="entryFormScrollableDiv">
        <AddEntryForm role="form"   action='javascript:void();' >

            <h3>{isEdit ? t("editEntryHeading") :  t("newEntryHeading")}</h3>

            { this.props.error &&
              <div className= "err">
                { t("savingError") + ":" + this.props.error.message}
              </div>
            }
            { (!this.props.error) && this.props.submitFailed &&
              <div className="err"> { t("valueError") }
                <FieldElement aria-label="license error" name="license" component={errorMessage} />
              </div>
            }

            <div className= "pure-form">
              <Fieldset>
                <FieldElement aria-label="category" className="pure-input-1" name="category" disabled={ isEdit && isEvent } component="select" onChange={this.handleCategoryChange}>
                  <option value={-1}>{t("chooseCategory")}</option>
                  <option value={IDS.INITIATIVE}>{t("category." + NAMES[IDS.INITIATIVE])}</option>
                  <option value={IDS.COMPANY}>{t("category." + NAMES[IDS.COMPANY])}</option>
                  <option disabled={ isEdit } value={IDS.EVENT}>{t("category." + NAMES[IDS.EVENT])}</option>
                </FieldElement>

                <FieldElement aria-label="category error" name="category" component={errorMessage} />

                <FieldElement
                  aria-label="title"
                  name="title"
                  required={true}
                  className="pure-input-1"
                  type="text"
                  component="input"
                  placeholder={t("title")} />

                <FieldElement
                  aria-label="title error"
                  name="title"
                  component={errorMessage} />

                {(isEventEntry || isEvent ) && (

                  <RangeDates>

                    <Date>
                      <FieldElement
                        name="start"
                        component={ renderDatePickerStart }
                        className="pure-input-1"
                        initEndDate={ initEndDate }
                        endDate={ endDate }
                        onChange={ this.handleFromChange }
                        placeholderText={t("start")}
                      />

                      <FieldElement
                        name="start"
                        component={errorMessage}
                      />
                    </Date>

                    <Date>
                      <FieldElement
                        name="end"
                        component={ renderDatePickerEnd }
                        className="pure-input-1"
                        initStartDate={ initStartDate }
                        startDate={ startDate }
                        placeholderText={t("end")}
                        onChange={ this.handleToChange }
                      />

                      <FieldElement
                        name="end"
                        component={errorMessage}
                      />
                    </Date>

                  </RangeDates>

                )}

                <FieldElement aria-label="description" name="description" className="pure-input-1" component="textarea" placeholder={t("description")}  />
                {isDescriptionTooLong && <div className="warn">{t("keepDescriptionShort")}</div>}
                <FieldElement aria-label="description error" name="description" component={errorMessage} />

                <FieldElement
                  aria-label="tags"
                  name="tags"
                  required={true}
                  className="pure-input-1"
                  placeholder={t("tags")}
                  component={SelectTags}
                />
                <FieldElement
                  aria-label="tags error"
                  name="tags"
                  component={errorMessage}
                />
              </Fieldset>

              <Fieldset>
                <FieldsetLegend>
                  <FieldsetTitle aria-label="location section">{t("location")}</FieldsetTitle>
                </FieldsetLegend>

                <div className={classNames("pure-g", "hidden")}>
                  <div className= "pure-u-12-24">
                    <FieldElement name="country" className="pure-input-1" component="input" placeholder={"Country"} />
                    <FieldElement name="country" component={errorMessage} />
                  </div>
                  <div className= "pure-u-12-24">
                    <FieldElement name="state" className="pure-input-1" component="input" placeholder={"State"} />
                    <FieldElement name="state" component={errorMessage} />
                  </div>
                </div>

                <div className= "pure-g">
                  <div className= "pure-u-12-24">
                    <FieldElement name="city" className="pure-input-1" component="input" placeholder={t("city")} />
                    <FieldElement name="city" component={errorMessage} />
                  </div>
                  <div className= "pure-u-12-24">
                    <FieldElement name="zip" className="pure-input-1" component="input" placeholder={t("zip")} />
                    <FieldElement name="zip" component={errorMessage} />
                  </div>
                </div>

                <FieldElement name="street" className="pure-input-1" component="input" placeholder={t("street")}/>
                <FieldElement name="street" component={errorMessage} />

                <ClickOnMapText>{t("clickOnMap")}</ClickOnMapText>

                <div className= "pure-g">
                  <label className= "pure-u-2-24">
                    <FontAwesomeIcon icon="map-marker" />
                  </label>
                  <div className= "pure-u-22-24 pure-g">
                    <div className= "pure-u-11-24">
                      <FieldElement
                        aria-label="latitude"
                        name="lat"
                        className="pure-input-1"
                        component="input"
                        readOnly={true}
                        placeholder="Latitude"
                      />
                      <FieldElement aria-label="latitude error" name="lat" component={errorMessage} />
                    </div>
                    <div className= "pure-u-2-24" />
                    <div className= "pure-u-11-24">
                      <FieldElement
                        aria-label="longitude"
                        name="lng"
                        className="pure-input-1"
                        component="input"
                        readOnly={true}
                        placeholder="longitude"
                      />
                      <FieldElement aria-label="longitude error" name="lng" component={errorMessage} />
                    </div>
                  </div>
                </div>
              </Fieldset>

              <Fieldset>
                <OptionalLegend>
                  <FieldsetTitle aria-label="contact section">{t("contact")}</FieldsetTitle>
                </OptionalLegend>

                {
                  this.state.isEventEntry &&
                  <div className= "pure-g">
                    <OptionalFieldLabel className= "pure-u-2-24">
                      <FontAwesomeIcon icon="user" />
                    </OptionalFieldLabel>
                    <div className= "pure-u-22-24">
                      <FieldElement
                        aria-label="organizer"
                        name="organizer"
                        className="pure-input-1 optional"
                        component="input"
                        placeholder={t("contactPerson")} />
                      <FieldElement name="organizer" component={errorMessage} />
                    </div>
                  </div>
                }

                <div className= "pure-g">
                  <OptionalFieldLabel className= "pure-u-2-24">
                    <FontAwesomeIcon icon="phone" />
                  </OptionalFieldLabel>
                  <div className= "pure-u-22-24">
                    <FieldElement aria-label="telephone" name="telephone" className="pure-input-1 optional" component="input" placeholder={t("phone")} />
                    <FieldElement aria-label="telephone error" name="telephone" component={errorMessage} />
                  </div>
                </div><commit_msg>feat: add organizer for all entries (not only the events)<commit_after>import React, { Component, Fragment } from "react";
import { connect }          from 'react-redux'
import { translate        } from "react-i18next";
import T                    from "prop-types";
import styled               from "styled-components";
import classNames            from "classnames";
import DatePicker from 'react-datepicker';
import { FontAwesomeIcon }  from '@fortawesome/react-fontawesome'
import { reduxForm, Field, initialize}       from "redux-form";

import update from 'immutability-helper'
import lodashGet from 'lodash/get'
import moment, {min} from 'moment'

import 'react-datepicker/dist/react-datepicker.min.css';
import en_GB from "date-fns/locale/en-GB";

import {pink} from './styling/Variables';
import Actions              from "../Actions";
import validation           from "../util/validation";
import NavButton            from "./pure/NavButton";
import { IDS, NAMES }       from "../constants/Categories";
import URLs                 from "../constants/URLs";
import LICENSES             from "../constants/Licenses";
import { EDIT             } from "../constants/Form";
import SelectTags           from './SelectTags';
import ScrollableDiv        from "./pure/ScrollableDiv";
import NavButtonWrapper     from "./pure/NavButtonWrapper";



const renderDatePickerStart = ({input, initEndDate, endDate, ...props}) => {
  const minDate = moment()
  const minTime = moment()

  const isDateSelected = !!input.value
  let selectedDate = new window.Date()
  if (isDateSelected) {
    selectedDate = moment(input.value > 99999999999 ? input.value : ((input.value + (new window.Date(input.value * 1000).getTimezoneOffset() * 60)) * 1000))
  }

  if (isDateSelected && selectedDate.isAfter(new window.Date(), 'day')) {
    minTime.set({hour: 0, minute: 0})
  }

  return (
    <DatePicker
      {...props}
      locale={en_GB}
      selected={isDateSelected ? selectedDate.toDate() : ''}
      showTimeSelect
      timeFormat="HH:mm"
      dateFormat="dd.MM.yyyy HH:mm"
      onChange={(day) => input.onChange(day)}
      minDate={minDate.toDate()}
      maxDate={endDate ? endDate : (initEndDate ? initEndDate : '')}
      minTime={minTime.toDate()}
      maxTime={moment().set({hour: 23, minute: 30}).toDate()}
    />
  )
}

const renderDatePickerEnd = ({ input, initStartDate, startDate,  ...props }) => {
  const hasStartDate = !!startDate
  let firstDate = moment()
  if (hasStartDate) {
    firstDate = moment(startDate)
  } else if(initStartDate) {
    firstDate = moment(initStartDate)
  }

  const isDateSelected = !!input.value
  let selectedDate = new window.Date()
  if (isDateSelected) {
    selectedDate = moment(input.value > 99999999999 ? input.value : ((input.value + (new window.Date(input.value * 1000).getTimezoneOffset() * 60)) * 1000))
  }

  let minDate = firstDate.clone()
  let minTime = moment()

  // show all times
  if (!hasStartDate && !isDateSelected) {
    minTime = moment(firstDate).clone().add(30, 'minutes')
  } else if (hasStartDate && !isDateSelected) {
    minTime = moment(firstDate).clone().add(30, 'minutes')
  } else if (hasStartDate && isDateSelected) {
    if(selectedDate.isSame(firstDate, 'day')){
      minTime = moment(firstDate).clone().add(30, 'minutes')
      if (selectedDate.isSameOrBefore(firstDate)) {
        selectedDate = firstDate.clone().add(30, 'minute')
        if (selectedDate.isAfter(firstDate, 'day')) {
          minDate.add(1, 'day')
        }
      }
    } else if (selectedDate.isBefore(firstDate, 'day')) {
      selectedDate = firstDate.clone().add(30, 'minute')
      minTime = moment(firstDate).clone().add(30, 'minutes')
    } else if (selectedDate.isAfter(firstDate, 'day')) {
      minTime.set({hour: 0, minutes: 0})
    }
  }

  return (
    <DatePicker
      {...props}
      locale={en_GB}
      selected={isDateSelected ? selectedDate.toDate() : ''}
      showTimeSelect
      timeFormat="HH:mm"
      dateFormat="dd.MM.yyyy HH:mm"
      onChange={(day) => input.onChange(day)}
      minDate={minDate.toDate()}
      minTime={minTime.toDate()}
      maxTime={firstDate.clone().hours(23).minutes(30).toDate()}
      popperPlacement="bottom-end"
    />
  );
};

function convertToDateForPicker(date) {
  const d = new window.Date(date);
  return `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`;
}

class Form extends Component {
  state = {
    isEventEntry: false,
    startDate: '',
    endDate: '',
    numberOfCustomLinks: 1,
  };

  componentDidMount() {
    this.setState({
      isEventEntry: this.props.category === IDS.EVENT,
      numberOfCustomLinks: this.props.numberOfCustomLinks || 1
    })

    this.props.dispatch(Actions.search(true))
  }

  componentWillUnmount() {
    this.props.dispatch(Actions.search(false))
  }

  handleCategoryChange = (event) => {
    const category = event.target.value;
    this.setState({ isEventEntry: category=== IDS.EVENT});
  };

  handleFromChange = (from) => {
    this.setState({ startDate: from });
  };

  handleToChange = (to) => {
    this.setState({ endDate: to });
  };
 

  render() {
    const { isEdit, isEvent, formStartEndDate, descriptionLength, license, dispatch, handleSubmit } = this.props;

    const {saveButtonCustomization, cancelButtonCustomization} = this.props;

    const { isEventEntry, startDate, endDate } = this.state;
    const initStartDate = formStartEndDate.startDate ? new window.Date(formStartEndDate.startDate) : '';
    const initEndDate = formStartEndDate.endDate ? new window.Date(formStartEndDate.endDate) : '';
    // TODO: use process.env.ENTRY_DESCRIPTION_WARN_LIMIT instead of hard code
    const isDescriptionTooLong = descriptionLength > 250

    const t = (key) => {
      return this.props.t("entryForm." + key);
    };

    return (
    <FormWrapper>
      <ScrollableDiv id="entryFormScrollableDiv">
        <AddEntryForm role="form"   action='javascript:void();' >

            <h3>{isEdit ? t("editEntryHeading") :  t("newEntryHeading")}</h3>

            { this.props.error &&
              <div className= "err">
                { t("savingError") + ":" + this.props.error.message}
              </div>
            }
            { (!this.props.error) && this.props.submitFailed &&
              <div className="err"> { t("valueError") }
                <FieldElement aria-label="license error" name="license" component={errorMessage} />
              </div>
            }

            <div className= "pure-form">
              <Fieldset>
                <FieldElement aria-label="category" className="pure-input-1" name="category" disabled={ isEdit && isEvent } component="select" onChange={this.handleCategoryChange}>
                  <option value={-1}>{t("chooseCategory")}</option>
                  <option value={IDS.INITIATIVE}>{t("category." + NAMES[IDS.INITIATIVE])}</option>
                  <option value={IDS.COMPANY}>{t("category." + NAMES[IDS.COMPANY])}</option>
                  <option disabled={ isEdit } value={IDS.EVENT}>{t("category." + NAMES[IDS.EVENT])}</option>
                </FieldElement>

                <FieldElement aria-label="category error" name="category" component={errorMessage} />

                <FieldElement
                  aria-label="title"
                  name="title"
                  required={true}
                  className="pure-input-1"
                  type="text"
                  component="input"
                  placeholder={t("title")} />

                <FieldElement
                  aria-label="title error"
                  name="title"
                  component={errorMessage} />

                {(isEventEntry || isEvent ) && (

                  <RangeDates>

                    <Date>
                      <FieldElement
                        name="start"
                        component={ renderDatePickerStart }
                        className="pure-input-1"
                        initEndDate={ initEndDate }
                        endDate={ endDate }
                        onChange={ this.handleFromChange }
                        placeholderText={t("start")}
                      />

                      <FieldElement
                        name="start"
                        component={errorMessage}
                      />
                    </Date>

                    <Date>
                      <FieldElement
                        name="end"
                        component={ renderDatePickerEnd }
                        className="pure-input-1"
                        initStartDate={ initStartDate }
                        startDate={ startDate }
                        placeholderText={t("end")}
                        onChange={ this.handleToChange }
                      />

                      <FieldElement
                        name="end"
                        component={errorMessage}
                      />
                    </Date>

                  </RangeDates>

                )}

                <FieldElement aria-label="description" name="description" className="pure-input-1" component="textarea" placeholder={t("description")}  />
                {isDescriptionTooLong && <div className="warn">{t("keepDescriptionShort")}</div>}
                <FieldElement aria-label="description error" name="description" component={errorMessage} />

                <FieldElement
                  aria-label="tags"
                  name="tags"
                  required={true}
                  className="pure-input-1"
                  placeholder={t("tags")}
                  component={SelectTags}
                />
                <FieldElement
                  aria-label="tags error"
                  name="tags"
                  component={errorMessage}
                />
              </Fieldset>

              <Fieldset>
                <FieldsetLegend>
                  <FieldsetTitle aria-label="location section">{t("location")}</FieldsetTitle>
                </FieldsetLegend>

                <div className={classNames("pure-g", "hidden")}>
                  <div className= "pure-u-12-24">
                    <FieldElement name="country" className="pure-input-1" component="input" placeholder={"Country"} />
                    <FieldElement name="country" component={errorMessage} />
                  </div>
                  <div className= "pure-u-12-24">
                    <FieldElement name="state" className="pure-input-1" component="input" placeholder={"State"} />
                    <FieldElement name="state" component={errorMessage} />
                  </div>
                </div>

                <div className= "pure-g">
                  <div className= "pure-u-12-24">
                    <FieldElement name="city" className="pure-input-1" component="input" placeholder={t("city")} />
                    <FieldElement name="city" component={errorMessage} />
                  </div>
                  <div className= "pure-u-12-24">
                    <FieldElement name="zip" className="pure-input-1" component="input" placeholder={t("zip")} />
                    <FieldElement name="zip" component={errorMessage} />
                  </div>
                </div>

                <FieldElement name="street" className="pure-input-1" component="input" placeholder={t("street")}/>
                <FieldElement name="street" component={errorMessage} />

                <ClickOnMapText>{t("clickOnMap")}</ClickOnMapText>

                <div className= "pure-g">
                  <label className= "pure-u-2-24">
                    <FontAwesomeIcon icon="map-marker" />
                  </label>
                  <div className= "pure-u-22-24 pure-g">
                    <div className= "pure-u-11-24">
                      <FieldElement
                        aria-label="latitude"
                        name="lat"
                        className="pure-input-1"
                        component="input"
                        readOnly={true}
                        placeholder="Latitude"
                      />
                      <FieldElement aria-label="latitude error" name="lat" component={errorMessage} />
                    </div>
                    <div className= "pure-u-2-24" />
                    <div className= "pure-u-11-24">
                      <FieldElement
                        aria-label="longitude"
                        name="lng"
                        className="pure-input-1"
                        component="input"
                        readOnly={true}
                        placeholder="longitude"
                      />
                      <FieldElement aria-label="longitude error" name="lng" component={errorMessage} />
                    </div>
                  </div>
                </div>
              </Fieldset>

              <Fieldset>
                <OptionalLegend>
                  <FieldsetTitle aria-label="contact section">{t("contact")}</FieldsetTitle>
                </OptionalLegend>

                <div className= "pure-g">
                  <OptionalFieldLabel className= "pure-u-2-24">
                    <FontAwesomeIcon icon="user" />
                  </OptionalFieldLabel>
                  <div className= "pure-u-22-24">
                    <FieldElement
                      aria-label="organizer"
                      name="organizer"
                      className="pure-input-1 optional"
                      component="input"
                      placeholder={t("contactPerson")} />
                    <FieldElement name="organizer" component={errorMessage} />
                  </div>
                </div>

                <div className= "pure-g">
                  <OptionalFieldLabel className= "pure-u-2-24">
                    <FontAwesomeIcon icon="phone" />
                  </OptionalFieldLabel>
                  <div className= "pure-u-22-24">
                    <FieldElement aria-label="telephone" name="telephone" className="pure-input-1 optional" component="input" placeholder={t("phone")} />
                    <FieldElement aria-label="telephone error" name="telephone" component={errorMessage} />
                  </div>
                </div>
{'fraction_non_alphanumeric': 0.13223631345421513, 'fraction_numerical': 0.009852216748768473, 'mean_word_length': 1.7433390837646157, 'pattern_counts': {'":': 2, '<': 229, '<?xml version=': 0, '>': 251, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '215982', 'n_tokens_mistral': 7976, 'n_tokens_neox': 7312, 'n_words': 1393}