<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import inspect
import argparse
import abc
from fnmatch import fnmatch
from collections import OrderedDict
from six import add_metaclass, text_type

from .resource import Resource
from .resource import Collection, RootCollection
from .schema import ResourceNotDefined
from .utils import Path, classproperty, parallel_map
from .exceptions import CommandError, NotFound
from .context import Context


class ArgumentParser(argparse.ArgumentParser):

    def exit(self, status=0, message=None):
        raise CommandError(message or '')


class BaseOption(object):
    _creation_idx = 0

    def __init__(self, *args, **kwargs):
        self.attr = ''
        self.complete = None
        if 'complete' in kwargs:
            self.complete = kwargs.pop('complete')
        self.kwargs = kwargs
        # keep track of options order
        self._creation_idx = BaseOption._creation_idx
        BaseOption._creation_idx += 1

    @property
    def help(self):
        return self.kwargs.get('help', '') % self.kwargs

    @property
    def dest(self):
        return self.kwargs.get('get', self.attr)

    @property
    def is_multiple(self):
        return self.kwargs.get('nargs') in ('*', '+') or \
            self.kwargs.get('action') in ('append',)

    @property
    def nargs(self):
        if self.kwargs.get('nargs') == '?':
            return 1
        return self.kwargs.get('nargs', 1)

    def __repr__(self):
        return '%s(%s)' % (self.__class__.__name__, self.attr)


class Option(BaseOption):

    def __init__(self, short_name=None, **kwargs):
        BaseOption.__init__(self, **kwargs)
        self.short_name = short_name

    @property<commit_msg>Fix getting option value with dest<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import inspect
import argparse
import abc
from fnmatch import fnmatch
from collections import OrderedDict
from six import add_metaclass, text_type

from .resource import Resource
from .resource import Collection, RootCollection
from .schema import ResourceNotDefined
from .utils import Path, classproperty, parallel_map
from .exceptions import CommandError, NotFound
from .context import Context


class ArgumentParser(argparse.ArgumentParser):

    def exit(self, status=0, message=None):
        raise CommandError(message or '')


class BaseOption(object):
    _creation_idx = 0

    def __init__(self, *args, **kwargs):
        self.attr = ''
        self.complete = None
        if 'complete' in kwargs:
            self.complete = kwargs.pop('complete')
        self.kwargs = kwargs
        # keep track of options order
        self._creation_idx = BaseOption._creation_idx
        BaseOption._creation_idx += 1

    @property
    def help(self):
        return self.kwargs.get('help', '') % self.kwargs

    @property
    def dest(self):
        return self.kwargs.get('dest', self.attr)

    @property
    def is_multiple(self):
        return self.kwargs.get('nargs') in ('*', '+') or \
            self.kwargs.get('action') in ('append',)

    @property
    def nargs(self):
        if self.kwargs.get('nargs') == '?':
            return 1
        return self.kwargs.get('nargs', 1)

    def __repr__(self):
        return '%s(%s)' % (self.__class__.__name__, self.attr)


class Option(BaseOption):

    def __init__(self, short_name=None, **kwargs):
        BaseOption.__init__(self, **kwargs)
        self.short_name = short_name

    @property
{'fraction_non_alphanumeric': 0.10853589598643301, 'fraction_numerical': 0.0033917467495760316, 'mean_word_length': 3.012471655328798, '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': '92193', 'n_tokens_mistral': 1030, 'n_tokens_neox': 993, 'n_words': 288}