<commit_before>import uuidv4 from 'uuid-v4'

// ------------------------------------
// Constants
// ------------------------------------
export const SELECT_FRAME = 'SELECT_FRAME'
// ------------------------------------
// Actions
// ------------------------------------



export function selectFrame (id = 0, time = 0) {
  return {
    type: SELECT_FRAME,
    payload: {
      time: time,
      id: id
    }
  }
}

export const actions = {
  selectFrame
}

// ------------------------------------
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
  [SELECT_FRAME] : (state, action) => {
    return {
      ...state,
      selected: action.payload.id,
      instructions: {
        ...state.instructions,
        [uuidv4()]: {
          time: action.payload.time,
          frameid: action.payload.id
        }
      }
    }
  }
}

// ------------------------------------
// Reducer
// ------------------------------------
const initialState = { <commit_msg>dont allow duplicate frame times<commit_after>import uuidv4 from 'uuid-v4'

// ------------------------------------
// Constants
// ------------------------------------
export const SELECT_FRAME = 'SELECT_FRAME'
// ------------------------------------
// Actions
// ------------------------------------



export function selectFrame (frameid = 0, time = 0) {
  return {
    type: SELECT_FRAME,
    payload: {
      time: time,
      frameid: frameid
    }
  }
}

export const actions = {
  selectFrame
}

// ------------------------------------
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
  [SELECT_FRAME] : (state, action) => {
    let id = uuidv4();
    for (var i in state.instructions) {
      if (state.instructions[i].time === action.payload.time) id = i;
    }
    return {
      ...state,
      selected: action.payload.id,
      instructions: {
        ...state.instructions,
        [id]: {
          time: action.payload.time,
          frameid: action.payload.frameid
        }
      }
    }
  }
}

// ------------------------------------
// Reducer
// ------------------------------------
const initialState = { 
{'fraction_non_alphanumeric': 0.3681776133209991, 'fraction_numerical': 0.004625346901017576, 'mean_word_length': 0.9209591474245116, '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': '5383794', 'n_tokens_mistral': 560, 'n_tokens_neox': 548, 'n_words': 117}