def validate_arguments(func, args, kwargs, drop_extra=True):
 parser = _parse_signature(func)
 (args, kwargs, missing, extra, extra_positional) = parser(args, kwargs)[:5]
 if missing:
  raise ArgumentValidationError(tuple(missing))
 elif ((extra or extra_positional) and (not drop_extra)):
  raise ArgumentValidationError(None, extra, extra_positional)
 return (tuple(args), kwargs)

def validate_arguments ( func , args , kwargs , drop_extra = True ) : parser = _parse_signature ( func ) ( args , kwargs , missing , extra , extra_positional ) = parser ( args , kwargs ) [ : 5 ] if missing : raise ArgumentValidationError ( tuple ( missing ) ) elif ( ( extra or extra_positional ) and ( not drop_extra ) ) : raise ArgumentValidationError ( None , extra , extra_positional ) return ( tuple ( args ) , kwargs )
checks if the function accepts the arguments and keyword arguments .