Returns (args, kwargs) to be used when deserializing this parameter.
333071
def serialize_args(self):
        """"""

        args, kwargs = super(MultiParameter, self).serialize_args()
        args.insert(0, [[t.id, t.serialize_args()] for t in self.types])

        return args, kwargs
460696
def parse_args_kwargs(self, *args, **kwargs):
        ''''''
        # unpack the arginfo
        keys, defdict = self.arginfo
        assigned = keys[:len(args)]
        not_assigned = keys[len(args):]

        # validate kwargs
        for key in kwargs:
            assert key not in assigned
            assert key in keys

        # integrate args and kwargs
        knowns = dict(defdict, **kwargs)
        parsed_args = args + tuple([knowns[key] for key in not_assigned])
        return parsed_args
1189623
def _serialize_parameters(parameters):
        

        for key, value in parameters.items():
            if isinstance(value, bool):
                parameters[key] = "true" if value else "false"
            elif isinstance(value, dict):
                parameters[key] = "|".join(
                    ("%s:%s" % (k, v) for k, v in value.items()))
            elif isinstance(value, (list, tuple)):
                parameters[key] = "|".join(value)
        return parameters
186702
def _get(cls, kwarg_name):
        
        param_classes = cls._discover_params()
        try:
            param_class = param_classes[kwarg_name]
        except KeyError:
            raise ValueError('invalid param keyword {}'.format(kwarg_name))
        else:
            return param_class
291993
def args(self):  # as args tuple
        '''
        '''
        return (self.base, self.item, self.leng, self.refs,
                self.both, self.kind, self.type)
376377
def _get_args(self, kwargs):
        '''
        
        '''
        _args = list()
        _kwargs = salt.utils.args.clean_kwargs(**kwargs)

        return _args, _kwargs
253493
def parse(self, argv):
        """"""
        kwargs, args = self.parse_args(argv)
        self.result['args'] += args
        # Annoying that parse_args doesn't just return a dict
        for dest in self.dests:
            value = getattr(kwargs, dest)
            if value is not None:
                self.result['kwargs'][dest] = value
        return self
278929
def get_kwargs(self):
        
        return {
            'host': self.host,
            'port': self.port,
            'channel': self.channel,
            'password': self.password
        }
955964
def deserialize(to_deserialize, *args, **kwargs):
    
    if isinstance(to_deserialize, string_types):
        if re.match('^[0-9a-f]{24}$', to_deserialize):
            return ObjectId(to_deserialize)
        try:
            return bson_loads(to_deserialize, *args, **kwargs)
        except:
            return bson_loads(bson_dumps(to_deserialize), *args, **kwargs)
    else:
        return bson_loads(bson_dumps(to_deserialize), *args, **kwargs)
1134819
def deserialize(self, value, **kwargs):
        
        for validator in self.validators:
            validator.validate(value, **kwargs)

        return value
347802
def deserialize(self, value, **kwargs):
        
        kwargs.update({'trusted': kwargs.get('trusted', False)})
        if self.deserializer is not None:
            return self.deserializer(value, **kwargs)
        if value is None:
            return None
        return self.wrapper(value).astype(self.dtype[0])
516929
def _GetArgsDescription(self, args_type):
    """"""
    args = {}
    if args_type:
      for type_descriptor in args_type.type_infos:
        if not type_descriptor.hidden:
          args[type_descriptor.name] = {
              "description": type_descriptor.description,
              "default": type_descriptor.default,
              "type": "",
          }
          if type_descriptor.type:
            args[type_descriptor.name]["type"] = type_descriptor.type.__name__
    return args
232012
def _get_deserializer(cls, cls_for):
        

        if cls_for.__name__ in cls._custom_deserializers:
            return cls._custom_deserializers[cls_for.__name__]

        return JsonAdapter
914203
def get_args(args, kwargs, arg_names):
    '''
    '''
    n_args = len(arg_names)
    if len(args) + len(kwargs) > n_args:
        raise MoultScannerError('Too many arguments supplied. Expected: {}'.format(n_args))

    out_args = {}
    for i, a in enumerate(args):
        out_args[arg_names[i]] = a

    for a in arg_names:
        if a not in out_args:
            out_args[a] = None

    out_args.update(kwargs)
    return out_args
235282
def _parse_arguments():
        
        parser = get_base_arguments(get_parser())
        parser = get_tc_arguments(parser)
        args, unknown = parser.parse_known_args()
        return args, unknown
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
831240
def func_args_as_dict(func, args, kwargs):
    
    if six.PY2:
        _getargspec = inspect.getargspec
    else:
        _getargspec = inspect.getfullargspec

    arg_names = list(
        OrderedDict.fromkeys(
            itertools.chain(
                _getargspec(func)[0],
                kwargs.keys()
            )
        )
    )
    return OrderedDict(
        list(six.moves.zip(arg_names, args)) +
        list(kwargs.items())
    )