<commit_before>#!/usr/bin/env python

"""Command line arguments parser.

(C) 2016-2018 1024jp
"""

import argparse
import logging
import os
import sys

try:
    from . import __version__ as version
except:
    version = 'n/a'


class Parser(argparse.ArgumentParser):
    description = 'Translate coordinates in a picture to the real world.'
    datafile_name = 'source'

    def __init__(self):
        argparse.ArgumentParser.__init__(self, description=self.description)
        self.init_arguments()

    def init_arguments(self):
        """Setup arguments of command.
        """
        # argument
        self.add_argument('file',
                          type=argparse.FileType('rb'),
                          metavar='FILE',
                          nargs='?',
                          help="path to source file"
                          )

        # define options
        self.add_argument('--version',
                          action='version',
                          version=version
                          )
        self.add_argument('-t', '--test',
                          action='store_true',
                          default=False,
                          help="test the program"
                          )
        self.add_argument('-v', '--verbose',
                          action='store_true',
                          default=False,
                          help="display debug info to standard output"
                               " (default: %(default)s)"
                          )

        output = self.add_argument_group('output options')
        output.add_argument('--out',
                            type=argparse.FileType('w'),
                            default=sys.stdout,
                            metavar='FILE',
                            help="set path to output file"
                                 " (default: display to standard output)"
                            )

        # graph values
        fileformat = self.add_argument_group('format options')
        fileformat.add_argument('--size',
                                type=int,
                                nargs=2,
                                default=(3840, 2160),
                                metavar=('WIDTH', 'HEIGHT'),
                                help=("set dimension of the image"
                                      " (default: %(default)s)")
                                )
        fileformat.add_argument('--in_cols',
                                type=int,
                                nargs=2,
                                default=[2, 3],
                                metavar='INDEX',
                                help=("set column positions of x, y in file "
                                      " (default: %(default)s)")
                                )
        fileformat.add_argument('--out_cols',
                                type=int,
                                nargs=2,
                                default=None,
                                metavar='INDEX',
                                help=("set column positions of x, y in file for"
                                      " calibrated data"
                                      " (default: same as in_cols")
                                )

    @property
    def datafile(self):<commit_msg>Remove word “set ” from args help<commit_after>#!/usr/bin/env python

"""Command line arguments parser.

(C) 2016-2018 1024jp
"""

import argparse
import logging
import os
import sys

try:
    from . import __version__ as version
except:
    version = 'n/a'


class Parser(argparse.ArgumentParser):
    description = 'Translate coordinates in a picture to the real world.'
    datafile_name = 'source'

    def __init__(self):
        argparse.ArgumentParser.__init__(self, description=self.description)
        self.init_arguments()

    def init_arguments(self):
        """Setup arguments of command.
        """
        # argument
        self.add_argument('file',
                          type=argparse.FileType('rb'),
                          metavar='FILE',
                          nargs='?',
                          help="path to source file"
                          )

        # define options
        self.add_argument('--version',
                          action='version',
                          version=version
                          )
        self.add_argument('-t', '--test',
                          action='store_true',
                          default=False,
                          help="test the program"
                          )
        self.add_argument('-v', '--verbose',
                          action='store_true',
                          default=False,
                          help="display debug info to standard output"
                               " (default: %(default)s)"
                          )

        output = self.add_argument_group('output options')
        output.add_argument('--out',
                            type=argparse.FileType('w'),
                            default=sys.stdout,
                            metavar='FILE',
                            help="path to output file"
                                 " (default: display to standard output)"
                            )

        # graph values
        fileformat = self.add_argument_group('format options')
        fileformat.add_argument('--size',
                                type=int,
                                nargs=2,
                                default=(3840, 2160),
                                metavar=('WIDTH', 'HEIGHT'),
                                help=("dimension of the image"
                                      " (default: %(default)s)")
                                )
        fileformat.add_argument('--in_cols',
                                type=int,
                                nargs=2,
                                default=[2, 3],
                                metavar='INDEX',
                                help=("column positions of x, y in file "
                                      " (default: %(default)s)")
                                )
        fileformat.add_argument('--out_cols',
                                type=int,
                                nargs=2,
                                default=None,
                                metavar='INDEX',
                                help=("column positions of x, y in file for"
                                      " calibrated data"
                                      " (default: same as in_cols")
                                )

    @property
    def datafile(self):
{'fraction_non_alphanumeric': 0.0898775753956405, 'fraction_numerical': 0.0074649148999701405, 'mean_word_length': 0.9069171648163963, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '771744', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1457, 'n_words': 318}