<commit_before>import Vue from 'vue'
import * as types from './mutation-types'
import OpenTrons from '../rest_api_wrapper'
import {addHrefs} from '../util'


const actions = {
  connect_robot ({ commit }, port) {
    const payload = {is_connected: true, 'port': port}
    OpenTrons.connect(port).then((was_successful) => {
      if (was_successful) commit(types.UPDATE_ROBOT_CONNECTION, payload)
    })
  },
  disconnect_robot ({ commit }) {
    OpenTrons.disconnect().then((was_successful) => {
      if (was_successful) {
        commit(types.UPDATE_ROBOT_CONNECTION, {'is_connected': false, 'port': null})
      }
    })
  },
  updateFilename ({commit}, fileName) {
    commit(types.UPDATE_FILE_NAME, {'fileName': fileName})
  },
  uploadProtocol ({commit}, formData) {
    commit(types.UPDATE_ROBOT_STATE, {'busy': true})
    OpenTrons.uploadProtocol(formData).then((result) =>{
      if (result.success) {
        let tasks = result.calibrations
        addHrefs(tasks)
        commit(types.UPDATE_TASK_LIST, {'tasks': tasks})
      } else {
        commit(types.UPDATE_TASK_LIST, {tasks: []})
      }
      commit(types.UPDATE_WARNINGS, {warning: result.warnings})
      commit(types.UPDATE_ERROR, {errors: result.errors})
      commit(types.UPDATE_ROBOT_STATE, {'busy': false})
    }),
    OpenTrons.getRunPlan().then((plan) => {
      commit(types.UPDATE_RUN_PLAN, {run_plan: plan})
    })
  },
  selectIncrement ({commit}, data) {<commit_msg>remove comma, function spacing<commit_after>import Vue from 'vue'
import * as types from './mutation-types'
import OpenTrons from '../rest_api_wrapper'
import {addHrefs} from '../util'


const actions = {
  connect_robot ({ commit }, port) {
    const payload = {is_connected: true, 'port': port}
    OpenTrons.connect(port).then((was_successful) => {
      if (was_successful) commit(types.UPDATE_ROBOT_CONNECTION, payload)
    })
  },
  disconnect_robot ({ commit }) {
    OpenTrons.disconnect().then((was_successful) => {
      if (was_successful) {
        commit(types.UPDATE_ROBOT_CONNECTION, {'is_connected': false, 'port': null})
      }
    })
  },
  updateFilename ({commit}, fileName) {
    commit(types.UPDATE_FILE_NAME, {'fileName': fileName})
  },
  uploadProtocol ({commit}, formData) {
    commit(types.UPDATE_ROBOT_STATE, {'busy': true})
    OpenTrons.uploadProtocol(formData).then((result) => {
      if (result.success) {
        let tasks = result.calibrations
        addHrefs(tasks)
        commit(types.UPDATE_TASK_LIST, {'tasks': tasks})
      } else {
        commit(types.UPDATE_TASK_LIST, {tasks: []})
      }
      commit(types.UPDATE_WARNINGS, {warning: result.warnings})
      commit(types.UPDATE_ERROR, {errors: result.errors})
      commit(types.UPDATE_ROBOT_STATE, {'busy': false})
    })
    OpenTrons.getRunPlan().then((plan) => {
      commit(types.UPDATE_RUN_PLAN, {run_plan: plan})
    })
  },
  selectIncrement ({commit}, data) {
{'fraction_non_alphanumeric': 0.1514217197670435, 'fraction_numerical': 0.0, 'mean_word_length': 3.612954186413902, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2248880', 'n_tokens_mistral': 949, 'n_tokens_neox': 954, 'n_words': 171}