# 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
            returned = max(0, returned - 1)
        return returned
    def get_self_arg_name(self):
        if self.is_bound_method() and len(self._args) > 0:
            return self._args[0].name
        return None
    def get_arg_names(self):
        return (arg.name for arg in self.get_args())
    def get_required_arg_names(self):
        return set(arg.name for arg in self.get_args() if not arg.has_default())
    def has_variable_args(self):
        return self._varargs_name is not None
    def has_variable_kwargs(self):
        return self._kwargs_name is not None
    def get_normalized_args(self, args, kwargs):
        returned = {}
        self._update_normalized_positional_args(returned, args)
        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):

# 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

            returned = max(0, returned - 1)
        return returned
    def get_self_arg_name(self):
        if self.is_bound_method() and len(self._args) > 0:
            return self._args[0].name
        return None
    def get_arg_names(self):
        return (arg.name for arg in self.get_args())
    def get_required_arg_names(self):
        return set(arg.name for arg in self.get_args() if not arg.has_default())
    def has_variable_args(self):
        return self._varargs_name is not None
    def has_variable_kwargs(self):
        return self._kwargs_name is not None
    def get_normalized_args(self, args, kwargs):
        returned = {}
        self._update_normalized_positional_args(returned, args)
        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,))