def __call__(self, func):
        def wrapper(*args, **kwargs):
            args = list(args)
            if isinstance(self.arg_id, int):
                try:
                    arg = args[self.arg_id]
                except __HOLE__:
                    raise ConverterError('Total positional args = {:d}, '
                        'but you apply converter for {:d} argument '
                        '(indexing starts from 0)'.format(len(args), self.arg_id))
                arg = self.convert(arg)
                args[self.arg_id] = arg
            elif isinstance(self.arg_id, str):
                arg = kwargs.get(self.arg_id)
                if arg:
                    arg = self.convert(arg)
                    kwargs[self.arg_id] = arg
                if not arg and self.required:
                    raise ConverterError('Keyword argument "{}" is required'\
                                            .format(self.arg_id))
            return func(*args, **kwargs)
        return wrapper
dataset/ETHPy150Open SmartTeleMax/iktomi/iktomi/cli/base.py/argument.__call__