# Path: infi/pyutils/exceptions.py
# class SignatureException(ReflectionException):
#     pass
# 
# class InvalidKeywordArgument(ReflectionException):
#     pass
# 
# class UnknownArguments(SignatureException):
#     pass
# 
# class MissingArguments(SignatureException):
#     pass


from types import MethodType
from .exceptions import (
    SignatureException,
    InvalidKeywordArgument,
    UnknownArguments,
    MissingArguments,
    )
from numbers import Number
import copy
import inspect
import itertools
import platform
        self._update_normalized_kwargs(returned, kwargs)
        self._check_missing_arguments(returned)
        self._check_unknown_arguments(returned)
        return returned
    def _update_normalized_positional_args(self, returned, args):
        argument_names = list(self.get_arg_names())
        argument_names.extend(range(len(args) - self.get_num_args()))
        for arg_name, given_arg in zip(argument_names, args):
            returned[arg_name] = given_arg

    def _update_normalized_kwargs(self, returned, kwargs):
        for arg_name, arg in iteritems(kwargs):
            if not isinstance(arg_name, basestring):
                raise InvalidKeywordArgument("Invalid keyword argument %r" % (arg_name,))
            if arg_name in returned:
                raise SignatureException("%s is given more than once to %s" % (arg_name, self.func_name))
            returned[arg_name] = arg

    def _check_missing_arguments(self, args_dict):
        required_arguments = self.get_required_arg_names()
        missing_arguments = required_arguments - set(args_dict)
        if missing_arguments:
            raise MissingArguments("The following arguments were not specified: %s" % ",".join(map(repr, missing_arguments)))
    def _check_unknown_arguments(self, args_dict):
        positional_arg_count = len([arg_name for arg_name in args_dict if isinstance(arg_name, Number)])
        num_args = self.get_num_args()
        if positional_arg_count and not self.has_variable_args():
            raise UnknownArguments("%s receives %s positional arguments (%s specified)" % (self.func_name, num_args, num_args + positional_arg_count))
        unknown = set(arg for arg in args_dict if not isinstance(arg, Number)) - set(self.get_arg_names())
        if unknown and not self.has_variable_kwargs():

# Path: infi/pyutils/exceptions.py
# class SignatureException(ReflectionException):
#     pass
# 
# class InvalidKeywordArgument(ReflectionException):
#     pass
# 
# class UnknownArguments(SignatureException):
#     pass
# 
# class MissingArguments(SignatureException):
#     pass


# Path: infi/pyutils/function_signature.py
from types import MethodType
from .exceptions import (
    SignatureException,
    InvalidKeywordArgument,
    UnknownArguments,
    MissingArguments,
    )
from numbers import Number
import copy
import inspect
import itertools
import platform

        self._update_normalized_kwargs(returned, kwargs)
        self._check_missing_arguments(returned)
        self._check_unknown_arguments(returned)
        return returned
    def _update_normalized_positional_args(self, returned, args):
        argument_names = list(self.get_arg_names())
        argument_names.extend(range(len(args) - self.get_num_args()))
        for arg_name, given_arg in zip(argument_names, args):
            returned[arg_name] = given_arg

    def _update_normalized_kwargs(self, returned, kwargs):
        for arg_name, arg in iteritems(kwargs):
            if not isinstance(arg_name, basestring):
                raise InvalidKeywordArgument("Invalid keyword argument %r" % (arg_name,))
            if arg_name in returned:
                raise SignatureException("%s is given more than once to %s" % (arg_name, self.func_name))
            returned[arg_name] = arg

    def _check_missing_arguments(self, args_dict):
        required_arguments = self.get_required_arg_names()
        missing_arguments = required_arguments - set(args_dict)
        if missing_arguments:
            raise MissingArguments("The following arguments were not specified: %s" % ",".join(map(repr, missing_arguments)))
    def _check_unknown_arguments(self, args_dict):
        positional_arg_count = len([arg_name for arg_name in args_dict if isinstance(arg_name, Number)])
        num_args = self.get_num_args()
        if positional_arg_count and not self.has_variable_args():
            raise UnknownArguments("%s receives %s positional arguments (%s specified)" % (self.func_name, num_args, num_args + positional_arg_count))
        unknown = set(arg for arg in args_dict if not isinstance(arg, Number)) - set(self.get_arg_names())
        if unknown and not self.has_variable_kwargs():

            raise UnknownArguments("%s received unknown argument(s): %s" % (self.func_name, ",".join(unknown)))