<commit_before>let s:V = gita#vital()
let s:ArgumentParser = s:V.import('ArgumentParser')

function! s:get_parser() abort
  if !exists('s:parser') || g:gita#develop
    let s:parser = s:ArgumentParser.new({
          \ 'name': 'Gita patch',
          \ 'description': 'Partially add/reset changes to/from index (UI only)',
          \ 'complete_threshold': g:gita#complete_threshold,
          \})
    call s:parser.add_argument(
          \ '--opener', '-o',
          \ 'a way to open a new buffer such as "edit", "split", etc.', {
          \   'type': s:ArgumentParser.types.value,
          \})
    call s:parser.add_argument(
          \ '--selection',
          \ 'a line number or range of the selection', {
          \   'pattern': '^\%(\d\+\|\d\+-\d\+\)$',
          \})
    call s:parser.add_argument(
          \ '--reverse',
          \ 'compare difference from HEAD instead of working tree', {
          \   'superordinates': ['one', 'two'],
          \})
    call s:parser.add_argument(
          \ '--one', '-1',
          \ 'open a patchable diff buffer', {
          \   'conflicts': ['two', 'three'],
          \})
    call s:parser.add_argument(
          \ '--two', '-2',
          \ 'open a patchable index and workspace buffers', {
          \   'conflicts': ['one', 'three'],
          \})
    call s:parser.add_argument(
          \ '--three', '-3',
          \ 'open a HEAD, patchable index, and workspace buffers', {
          \   'conflicts': ['one', 'two'],
          \})
    call s:parser.add_argument(
          \ 'filename',
          \ 'a filename going to be patched. if omited, the current buffer is used', {
          \   'complete': function('gita#complete#filename'),
          \})
    function! s:parser.hooks.post_validate(options) abort
      if get(a:options, 'one')
        let a:options.method = 'one'
        unlet a:options.one
      elseif get(a:options, 'two')
        let a:options.method = 'two'
        unlet a:options.two
      else
        let a:options.method = 'three'
        unlet a:options.three
      endif
    endfunction
    call s:parser.hooks.validate()
  endif
  return s:parser
endfunction<commit_msg>Fix key not present in dictionary issue on Gita patch<commit_after>let s:V = gita#vital()
let s:ArgumentParser = s:V.import('ArgumentParser')

function! s:get_parser() abort
  if !exists('s:parser') || g:gita#develop
    let s:parser = s:ArgumentParser.new({
          \ 'name': 'Gita patch',
          \ 'description': 'Partially add/reset changes to/from index (UI only)',
          \ 'complete_threshold': g:gita#complete_threshold,
          \})
    call s:parser.add_argument(
          \ '--opener', '-o',
          \ 'a way to open a new buffer such as "edit", "split", etc.', {
          \   'type': s:ArgumentParser.types.value,
          \})
    call s:parser.add_argument(
          \ '--selection',
          \ 'a line number or range of the selection', {
          \   'pattern': '^\%(\d\+\|\d\+-\d\+\)$',
          \})
    call s:parser.add_argument(
          \ '--reverse',
          \ 'compare difference from HEAD instead of working tree', {
          \   'superordinates': ['one', 'two'],
          \})
    call s:parser.add_argument(
          \ '--one', '-1',
          \ 'open a patchable diff buffer', {
          \   'conflicts': ['two', 'three'],
          \})
    call s:parser.add_argument(
          \ '--two', '-2',
          \ 'open a patchable index and workspace buffers', {
          \   'conflicts': ['one', 'three'],
          \})
    call s:parser.add_argument(
          \ '--three', '-3',
          \ 'open a HEAD, patchable index, and workspace buffers', {
          \   'conflicts': ['one', 'two'],
          \})
    call s:parser.add_argument(
          \ 'filename',
          \ 'a filename going to be patched. if omited, the current buffer is used', {
          \   'complete': function('gita#complete#filename'),
          \})
    function! s:parser.hooks.post_validate(options) abort
      if get(a:options, 'one')
        let a:options.method = 'one'
        unlet a:options.one
      elseif get(a:options, 'two')
        let a:options.method = 'two'
        unlet a:options.two
      else
        let a:options.method = 'three'
        silent! unlet! a:options.three
      endif
    endfunction
    call s:parser.hooks.validate()
  endif
  return s:parser
endfunction
{'fraction_non_alphanumeric': 0.15841132161606938, 'fraction_numerical': 0.0013695503309746632, 'mean_word_length': 1.9000661813368631, 'pattern_counts': {'":': 0, '<': 3, '<?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': '644114', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1342, 'n_words': 339}