<commit_before>import { List, Map } from 'immutable';
import {
  createGrid, createPalette, resetIntervals,
  checkColorInPalette, addColorToLastCellInPalette
} from './reducerHelpers';

const GRID_INITIAL_COLOR = '#313131';

function setInitialState(state) {
  const cellSize = 10;
  const columns = 20;
  const rows = 20;
  const currentColor = '#000000';
  const frame = createGrid(columns * rows, GRID_INITIAL_COLOR, 0);
  const paletteGrid = createPalette();
  const dragging = false;

  const initialState = {
    frames: [frame],
    paletteGridData: paletteGrid,
    cellSize,
    columns,
    rows,
    currentColor,
    initialColor: GRID_INITIAL_COLOR,
    eraserOn: false,
    eyedropperOn: false,
    colorPickerOn: false,
    loading: false,
    notifications: List(),
    dragging,
    activeFrameIndex: 0,
    duration: 1
  };

  return state.merge(initialState);
}

function setGridDimension(state, columns, rows) {
  const framesCount = state.get('frames').size;
  let newFrames = List();

  for (let i = 0; i < framesCount; i++) {
    newFrames = newFrames.push(createGrid(
      parseInt(columns, 10) * parseInt(rows, 10),
      GRID_INITIAL_COLOR,
      0
    ));
  }

  return state.merge({
    frames: resetIntervals(newFrames),
    rows: parseInt(rows, 10),
    columns: parseInt(columns, 10)
  });
}

function startDrag(state) {
  return state.merge({ dragging: true });
}

function endDrag(state) {
  return state.merge({ dragging: false });
}

function setColorSelected(state, newColorSelected) {
  const newState = {
    currentColor: newColorSelected,
    eraserOn: false,
    eyedropperOn: false,
    colorPickerOn: false
  };
  const paletteGridData = state.get('paletteGridData');

  if (!checkColorInPalette(paletteGridData, newColorSelected)) {<commit_msg>Initial frame interval 100<commit_after>import { List, Map } from 'immutable';
import {
  createGrid, createPalette, resetIntervals,
  checkColorInPalette, addColorToLastCellInPalette
} from './reducerHelpers';

const GRID_INITIAL_COLOR = '#313131';

function setInitialState(state) {
  const cellSize = 10;
  const columns = 20;
  const rows = 20;
  const currentColor = '#000000';
  const frame = createGrid(columns * rows, GRID_INITIAL_COLOR, 100);
  const paletteGrid = createPalette();
  const dragging = false;

  const initialState = {
    frames: [frame],
    paletteGridData: paletteGrid,
    cellSize,
    columns,
    rows,
    currentColor,
    initialColor: GRID_INITIAL_COLOR,
    eraserOn: false,
    eyedropperOn: false,
    colorPickerOn: false,
    loading: false,
    notifications: List(),
    dragging,
    activeFrameIndex: 0,
    duration: 1
  };

  return state.merge(initialState);
}

function setGridDimension(state, columns, rows) {
  const framesCount = state.get('frames').size;
  let newFrames = List();

  for (let i = 0; i < framesCount; i++) {
    newFrames = newFrames.push(createGrid(
      parseInt(columns, 10) * parseInt(rows, 10),
      GRID_INITIAL_COLOR,
      100
    ));
  }

  return state.merge({
    frames: resetIntervals(newFrames),
    rows: parseInt(rows, 10),
    columns: parseInt(columns, 10)
  });
}

function startDrag(state) {
  return state.merge({ dragging: true });
}

function endDrag(state) {
  return state.merge({ dragging: false });
}

function setColorSelected(state, newColorSelected) {
  const newState = {
    currentColor: newColorSelected,
    eraserOn: false,
    eyedropperOn: false,
    colorPickerOn: false
  };
  const paletteGridData = state.get('paletteGridData');

  if (!checkColorInPalette(paletteGridData, newColorSelected)) {
{'fraction_non_alphanumeric': 0.11287183764247985, 'fraction_numerical': 0.019182652210175146, 'mean_word_length': 3.955922865013774, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6175595', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1137, 'n_words': 277}