Prepare arguments required to apply function.
335941
def prepare_callable(self, fn, partial=False):
        """"""
        notes, keyword_notes = self.get_annotations(fn)
        return self.prepare_notes(*notes, __partial=partial, **keyword_notes)
119837
def apply_args(job, inputs, optional_inputs=None):
    
    _apply_args_loop(job, inputs, INPUT_FIELD)
    _apply_args_loop(job, optional_inputs, OPTIONAL_FIELD)
    return job
1083978
def _format_arguments(ctx):
    """"""
    params = [x for x in ctx.command.params if isinstance(x, click.Argument)]

    for param in params:
        for line in _format_argument(param):
            yield line
        yield ''
482279
def apply(self, func, **kwargs):
        
        with np.errstate(all='ignore'):
            result = func(self.values, **kwargs)
        if not isinstance(result, Block):
            result = self.make_block(values=_block_shape(result,
                                                         ndim=self.ndim))

        return result
463919
def _prepare_arguments(self, arguments):
        
        # Split arguments if given as string
        if arguments is not None:
            if isinstance(arguments, basestring):
                self.arguments = arguments.split()
            else:
                self.arguments = arguments
        # Otherwise properly decode command line arguments
        else:
            self.arguments = [arg.decode("utf-8") for arg in sys.argv[1:]]
930004
def restrict_args(func, *args, **kwargs):
    '''
    
    '''
    callargs = getargspec(func)
    if not callargs.varargs:
        args = args[0:len(callargs.args)]
    return func(*args, **kwargs)
853468
def _apply_outputter(self, func, mod):
        '''
        
        '''
        if hasattr(mod, '__outputter__'):
            outp = mod.__outputter__
            if func.__name__ in outp:
                func.__outputter__ = outp[func.__name__]
1081029
def prepare_service(args=None):
    """"""
    options.register_opts(cfg.CONF)
    services.load_service_opts(cfg.CONF)
    _configure(args)
    _setup_logging()

    cfg.CONF.log_opt_values(logging.getLogger(), logging.DEBUG)
122098
def apply_kwargs(func, **kwargs):
    
    new_kwargs = {}
    params = signature(func).parameters
    for param_name in params.keys():
        if param_name in kwargs:
            new_kwargs[param_name] = kwargs[param_name]
    return func(**new_kwargs)
952268
function prepareArgs(opts) {
  var valueFromOpts = valueFrom.bind(null, opts);

  return Object.keys(opts).reduce(function(acc, item) {
    acc.splice(indexFromArgs(item), 0, valueFromOpts(item));

    return acc;
  }, []);
}
438547
function _apply(func, thisArg, promisedArgs) {
		return well.all(promisedArgs || []).then(function(args) {
			return func.apply(thisArg, args);
		});
	}
173510
def setup_arguments(arguments):
    '''
    
    '''

    # Ensure parallel/port are numbers
    for key in ('--parallel', '--port', '--fail-percent'):
        if arguments[key]:
            try:
                arguments[key] = int(arguments[key])
            except ValueError:
                raise CliError('{0} is not a valid integer for {1}'.format(
                    arguments[key], key,
                ))

    # Prep --run OP ARGS
    if arguments['--run']:
        op, args = setup_op_and_args(arguments['--run'], arguments['ARGS'])
    else:
        op = args = None

    # Check deploy file exists
    if arguments['DEPLOY']:
        if not path.exists(arguments['DEPLOY']):
            raise CliError('Deploy file not found: {0}'.format(arguments['DEPLOY']))

    # Check our key file exists
    if arguments['--key']:
        if not path.exists(arguments['--key']):
            raise CliError('Private key file not found: {0}'.format(arguments['--key']))

    # Setup the rest
    return {
        # Deploy options
        'inventory': arguments['-i'],
        'deploy': arguments['DEPLOY'],
        'verbose': arguments['-v'],
        'dry': arguments['--dry'],
        'serial': arguments['--serial'],
        'no_wait': arguments['--no-wait'],
        'debug': arguments['--debug'],

        'debug_data': arguments['--debug-data'],
        'debug_state': arguments['--debug-state'],

        'fact': arguments['--fact'],

        'limit': arguments['--limit'],
        'op': op,
        'op_args': args,

        # Config options
        'user': arguments['--user'],
        'key': arguments['--key'],
        'key_password': arguments['--key-password'],
        'password': arguments['--password'],
        'port': arguments['--port'],
        'sudo': arguments['--sudo'],
        'sudo_user': arguments['--sudo-user'],
        'su_user': arguments['--su-user'],
        'parallel': arguments['--parallel'],
        'fail_percent': arguments['--fail-percent'],
    }
769336
def _process_arguments(self, arguments):
        
        if not arguments:
            return None
        a = arguments.split(" :", 1)
        arglist = a[0].split()
        if len(a) == 2:
            arglist.append(a[1])
        return arglist
965833
def applymap(self, func, **kwargs):
        """"""
        return self.from_rdd(
            self._rdd.map(lambda data: data.applymap(func), **kwargs))
793326
def raise_null_argument(func):
    """"""
    def wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except TypeError as ex:
            if any(statement in ex.args[0] for statement in ['takes exactly',
                                                             'required positional argument']):
                raise NullArgument('Wrong number of arguments provided: ' + str(ex.args[0]))
            else:
                raise
    return wrapper
478384
def prepare(cls, *args, **kwargs):
        
        cls.args = args
        cls.kwargs = kwargs
        cls.prepared = True
1014391
def build_function(name, args=None, defaults=None, doc=None):
    """"""
    args, defaults = args or [], defaults or []
    # first argument is now a list of decorators
    func = nodes.FunctionDef(name, doc)
    func.args = argsnode = nodes.Arguments()
    argsnode.args = []
    for arg in args:
        argsnode.args.append(nodes.Name())
        argsnode.args[-1].name = arg
        argsnode.args[-1].parent = argsnode
    argsnode.defaults = []
    for default in defaults:
        argsnode.defaults.append(nodes.const_factory(default))
        argsnode.defaults[-1].parent = argsnode
    argsnode.kwarg = None
    argsnode.vararg = None
    argsnode.parent = func
    if args:
        register_arguments(func)
    return func