<commit_before>import Icon from 'icon'
import React, { Component } from 'react'
import xo from 'xo'
import { Row, Col } from 'grid'
import { Text } from 'editable'
import {
  connectStore
} from 'utils'
import {
  createGetObject
} from 'selectors'

import VmActionBar from './action-bar'

// ===================================================================

@connectStore(() => {
  const getVm = createGetObject()

  const getContainer = createGetObject(
    (...args) => getVm(...args).$container
  )

  const getPool = createGetObject(
    (...args) => getVm(...args).$pool
  )

  return (state, props) => {
    const vm = getVm(state, props)
    if (!vm) {
      return {}
    }

    return {
      container: getContainer(state, props),
      pool: getPool(state, props),
      vm
    }
  }
})
export default class Header extends Component {
  render () {
    const { vm, container, pool } = this.props
    if (!vm || !pool) {
      return <Icon icon='loading' />
    }
    return <Row>
      <Col smallSize={6}>
        <h1>
          <Icon icon={`vm-${vm.power_state.toLowerCase()}`} />&nbsp;
          <Text
            onChange={(value) => xo.call('vm.set', { id: vm.id, name_label: value })}
          >{vm.name_label}</Text>
          <small className='text-muted'> - {container.name_label} ({pool.name_label})</small>
        </h1>
        <p className='lead'>
          <Text
            onChange={(value) => xo.call('vm.set', { id: vm.id, name_description: value })}
          >{vm.name_description}</Text>
        </p>
      </Col>
      <Col smallSize={6}>
        <div className='pull-xs-right'>
          <VmActionBar vm={vm} handlers={this.props}/>
        </div>
      </Col>
    </Row>
  }
}
<commit_msg>replace xo.call<commit_after>import Icon from 'icon'
import React, { Component } from 'react'
import { editVm } from 'xo'
import { Row, Col } from 'grid'
import { Text } from 'editable'
import {
  connectStore
} from 'utils'
import {
  createGetObject
} from 'selectors'

import VmActionBar from './action-bar'

// ===================================================================

@connectStore(() => {
  const getVm = createGetObject()

  const getContainer = createGetObject(
    (...args) => getVm(...args).$container
  )

  const getPool = createGetObject(
    (...args) => getVm(...args).$pool
  )

  return (state, props) => {
    const vm = getVm(state, props)
    if (!vm) {
      return {}
    }

    return {
      container: getContainer(state, props),
      pool: getPool(state, props),
      vm
    }
  }
})
export default class Header extends Component {
  render () {
    const { vm, container, pool } = this.props
    if (!vm || !pool) {
      return <Icon icon='loading' />
    }
    return <Row>
      <Col smallSize={6}>
        <h1>
          <Icon icon={`vm-${vm.power_state.toLowerCase()}`} />&nbsp;
          <Text
            onChange={(value) => editVm(vm, { name_label: value })}
          >{vm.name_label}</Text>
          <small className='text-muted'> - {container.name_label} ({pool.name_label})</small>
        </h1>
        <p className='lead'>
          <Text
            onChange={(value) => editVm(vm, { name_description: value })}
          >{vm.name_description}</Text>
        </p>
      </Col>
      <Col smallSize={6}>
        <div className='pull-xs-right'>
          <VmActionBar vm={vm} handlers={this.props}/>
        </div>
      </Col>
    </Row>
  }
}

{'fraction_non_alphanumeric': 0.20145772594752187, 'fraction_numerical': 0.0023323615160349854, 'mean_word_length': 2.4482412060301506, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 57, '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': '6924836', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1099, 'n_words': 251}