# Path: torext/errors.py
# class CommandArgumentError(TorextException):
#     pass


import sys
import inspect
import functools
import time
from .errors import CommandArgumentError
            args = all_args
            keyword_args = {}

        # Check args
        if len(args) < len(self.parameters):
            raise CommandArgumentError('Arguments too little')
        else:
            if not self.has_varargs and\
               len(args) > len(self.parameters) + len(self.keyword_parameters):
                raise CommandArgumentError('Arguments too much')

        # Check keyword args
        if not self.has_kwargs:
            for i in keyword_args:
                if not i in self.keyword_parameters:
                    raise CommandArgumentError('Unknown keyword parameter %s' % i)

        # Convert keyword args type
        # NOTE As keyword arguments passed as arguments are allwed,
        # and only recognized keyword arguments will be converted,
        # so keyword arguments passed as arguments will not be converted.
        for i in keyword_args:
            if i in self.keyword_parameters:
                default = self.keyword_parameters[i]
                converted = self._convert_to_type(
                    keyword_args[i], self._get_value_type(default))
                keyword_args[i] = converted

        return args, keyword_args


# Path: torext/errors.py
# class CommandArgumentError(TorextException):
#     pass


# Path: torext/script.py
import sys
import inspect
import functools
import time
from .errors import CommandArgumentError

            args = all_args
            keyword_args = {}

        # Check args
        if len(args) < len(self.parameters):
            raise CommandArgumentError('Arguments too little')
        else:
            if not self.has_varargs and\
               len(args) > len(self.parameters) + len(self.keyword_parameters):
                raise CommandArgumentError('Arguments too much')

        # Check keyword args
        if not self.has_kwargs:
            for i in keyword_args:
                if not i in self.keyword_parameters:
                    raise CommandArgumentError('Unknown keyword parameter %s' % i)

        # Convert keyword args type
        # NOTE As keyword arguments passed as arguments are allwed,
        # and only recognized keyword arguments will be converted,
        # so keyword arguments passed as arguments will not be converted.
        for i in keyword_args:
            if i in self.keyword_parameters:
                default = self.keyword_parameters[i]
                converted = self._convert_to_type(
                    keyword_args[i], self._get_value_type(default))
                keyword_args[i] = converted

        return args, keyword_args


    def _get_value_type(self, value):