callable->[],[]
    function that determines which argumnents have a default value
    :return: tuple of lists of names [args],[args_with_def]
490608
def get_args_kwargs(foo):
    
    spec = inspect.signature(foo)
    params = spec.parameters
    args,args_with_def=[],[]
    for n,p in params.items():
        if p.default is p.empty:
            args.append(n)
        else:
            args_with_def.append(n)
    return args,args_with_def
332430
def get_args_pairs(arguments):
    

    return ' '.join(' '.join(['-' + k, tcl_str(str(v))]) for k, v in arguments.items())
866685
def __arg_comps(self):
        '''
        
        '''
        fun = self.argv[0] if self.argv else ''
        parsed = salt.utils.args.parse_input(
            self.argv[1:],
            condition=False,
            no_parse=self.opts.get('no_parse', []))
        args = parsed[0]
        kws = parsed[1]
        return fun, args, kws
287511
def _get_defaults(func):
    """"""
    try:
        code = func.__code__
    except AttributeError:
        # Some built-in functions don't have __code__, __defaults__, etc.
        return {}
    pos_count = code.co_argcount
    arg_names = code.co_varnames
    arg_names = arg_names[:pos_count]
    defaults = func.__defaults__ or ()
    kwdefaults = func.__kwdefaults__
    res = dict(kwdefaults) if kwdefaults else {}
    pos_offset = pos_count - len(defaults)
    for name, value in zip(arg_names[pos_offset:], defaults):
        assert name not in res
        res[name] = value
    return res
906133
def get_current_args(caller_level = 0, func = None, argNames = None):
    
    if argNames is None:
        argNames = getargnames(getargspecs(func))
    if func is None:
        func = get_current_function(caller_level+1)
    if isinstance(func, property):
        func = func.fget if func.fset is None else func.fset
    stck = inspect.stack()
    lcs = stck[1+caller_level][0].f_locals
    return tuple([lcs[t] for t in argNames])
388677
def check_arguments(cls, passed):
        """"""
        defaults = list(cls.default_arguments().keys())
        template = ("Pass arg {argument:!r} in {cname:!r}, can be a typo? "
                    "Supported key arguments: {defaults}")
        fails = []
        for arg in passed:
            if arg not in defaults:
                warn(template.format(argument=arg,
                                     cname=cls.__name__,
                                     defaults=defaults))
                fails.append(arg)

        return any(fails)
617056
def parse_all_arguments(func):
    
    args = dict()
    if sys.version_info < (3, 0):
        func_args = inspect.getargspec(func)
        if func_args.defaults is not None:
            val = len(func_args.defaults)
            for i, itm in enumerate(func_args.args[-val:]):
                args[itm] = func_args.defaults[i]
    else:
        func_args = inspect.signature(func)
        for itm in list(func_args.parameters)[1:]:
            param = func_args.parameters[itm]
            if param.default is not param.empty:
                args[param.name] = param.default
    return args
1115539
def _gegetate_args(self, options):
        
        for optkey, optval in self._normalize_options(options):
            yield optkey

            if isinstance(optval, (list, tuple)):
                assert len(optval) == 2 and optval[0] and optval[
                    1], 'Option value can only be either a string or a (tuple, list) of 2 items'
                yield optval[0]
                yield optval[1]
            else:
                yield optval
881277
def str_args(args):
    
    res = []
    for x in args:
        if isinstance(x, tuple) and len(x) == 2:
            key, value = x
            if value and str_arg(value):
                res += ["%s=%s" % (key, str_arg(value))]
        else:
            res += [str_arg(x)]
    return ', '.join(res)
746623
def default_value(self):
        
        if callable(self.default) and self.call_default:
            return self.default()
        return self.default
362390
def verifyArguments(self, arg):
        
        for l in arg:
            if not type(l) == list and \
               not type(l) == type(Numeric.array([0.0])) and \
               not type(l) == tuple and \
               not type(l) == dict:
                return 0
            if type(l) == dict:
                for i in l:
                    if not type(i) == str and i not in list(self.layers.keys()):
                        return 0
            else:
                for i in l:
                    if not type(i) == float and not type(i) == int:
                        return 0
        return 1
573087
def fn_kwargs(callable):
    
    fn = get_fn(callable)
    (args, _, _, defaults) = _inspect.getargspec(fn)
    if defaults is None: return { }
    return dict(list(zip(reversed(args), reversed(defaults))))
732905
def _get_default_args(func):
    
    args, varargs, keywords, defaults = inspect.getargspec(func)
    print(args)
    return dict(zip(reversed(args), reversed(defaults)))
1343922
def check_argument_types(cllable = None, call_args = None, clss = None, caller_level = 0):
    
    return _check_caller_type(False, cllable, call_args, clss, caller_level+1)
1328160
def get_kwargs_defaults(argspec):
    """"""
    arg_names = tuple(argspec.args)
    defaults = argspec.defaults or ()
    num_args = len(argspec.args) - len(defaults)
    kwargs_defaults = {}
    for i, default_value in enumerate(defaults):
        kwargs_defaults[arg_names[num_args + i]] = default_value
    if getattr(argspec, "kwonlydefaults", None):
        kwargs_defaults.update(argspec.kwonlydefaults)
    return kwargs_defaults
884177
def get_parameter_defaults(self, include_flags=True):
        
        return {
            name: parameter.default
            for (name, parameter)
            in self.parameters.items()
            if parameter.default is not None and (include_flags or parameter.type != 'flag')
        }
341425
def _get_default_route_args(
            self,
            namespace,  # pylint: disable=unused-argument
            route,
            tag=False):
        """"""
        data_type, _ = unwrap_nullable(route.arg_data_type)
        if is_struct_type(data_type):
            arg_list = []
            for field in data_type.all_fields:
                if not field.has_default and not is_nullable_type(
                        field.data_type):
                    arg_list.append((fmt_var(field.name), fmt_type(
                        field.data_type, tag=tag)))

            doc_list = ([(fmt_var(f.name), self.process_doc(f.doc, self._docf))
                         for f in data_type.fields
                         if f.doc and not f.has_default and
                         not is_nullable_type(f.data_type)])
        else:
            arg_list = []
            doc_list = []

        return arg_list, doc_list