Call the lua scripts with given keys and args

        We add the separator to the arguments to be passed to the script

        For the parameters, see BaseRangeIndex.call_script
976093
def call_script(self, key, tmp_key, key_type, start, end, exclude, *args):
        

        args = list(args)
        args.append(self.separator)

        super(TextRangeIndex, self).call_script(
            key, tmp_key, key_type, start, end, exclude, *args
        )
928386
def format_args(options):
    
    args = list()

    for key, value in options.items():
        # convert foo_bar key into --foo-bar option
        key = key.replace('_', '-')

        if value is True:
            # key: True
            # --key
            args.append('--{key}'.format(key=key))
        elif is_sequence(value):
            # key: ['foo', 'bar']
            # --key=foo,bar
            values = [str(val) for val in value]
            args.append('--{key}={values}'.format(
                key=key, values=','.join(values)))
        else:
            # key: 'foo'
            # --key=foo
            args.append('--{key}={value}'.format(key=key, value=value))

    return args
1159440
def call(*args)

      bottom = stack_top

      load_onto_stack
        # load function on stack

      args.each { |arg| stack_push(arg) }
        # push arguments on stack

      pcall(bottom, args.length, nil, nil, nil)
    end
625656
def _arguments(code, module):
  
  arg_parser = CommandParser.create('')
  try:
    # Define our special argument 'types' and add them to the environment.
    builtins = {'source': _table, 'datestring': _datestring}
    env = {}
    env.update(builtins)

    # Execute the cell which should be one or more calls to arg().
    exec(code, env)

    # Iterate through the module dictionary. For any newly defined objects,
    # add args to the parser.
    for key in env:

      # Skip internal/private stuff.
      if key in builtins or key[0] == '_':
        continue
      # If we want to support importing query modules into other query modules, uncomment next 4
      # Skip imports but add them to the module
      # if isinstance(env[key], types.ModuleType):
      #   module.__dict__[key] = env[key]
      #   continue

      val = env[key]
      key = '--%s' % key

      if isinstance(val, bool):
        if val:
          arg_parser.add_argument(key, default=val, action='store_true')
        else:
          arg_parser.add_argument(key, default=val, action='store_false')
      elif isinstance(val, basestring) or isinstance(val, int) or isinstance(val, float) \
              or isinstance(val, int):
        arg_parser.add_argument(key, default=val)
      elif isinstance(val, list):
        arg_parser.add_argument(key, default=val, nargs='+')
      elif isinstance(val, tuple):
        arg_parser.add_argument(key, default=list(val), nargs='+')

      # Is this one of our pseudo-types for dates/tables?
      elif isinstance(val, dict) and 'type' in val:
        if val['type'] == 'datestring':
          arg_parser.add_argument(key, default='',
                                  type=_make_string_formatter(val['format'],
                                                              offset=val['offset']))
        elif val['type'] == 'table':
          if val['format'] is not None:
            arg_parser.add_argument(key, default='',
                                    type=_make_table_formatter(val['format'],
                                                               offset=val['offset']))
          else:
            arg_parser.add_argument(key, default=val['name'], type=_make_table)
        else:
          raise Exception('Cannot generate argument for %s of type %s' % (key, type(val)))
      else:
        raise Exception('Cannot generate argument for %s of type %s' % (key, type(val)))

  except Exception as e:
    print("%%sql arguments: %s from code '%s'" % (str(e), str(code)))
  return arg_parser
1093450
def _create_lua_method(self, name, code):
        
        script = self.register_script(code)
        setattr(script, "name", name)  # Helps debugging redis lib.
        method = lambda key, *a, **k: script(keys=[key], args=a, **k)
        setattr(self, name, method)
655874
function CallArguments_Argument(&$res, $sub)
    {
        if (!empty($res['php'])) {
            $res['php'] .= ', ';
        }

        $res['php'] .= ($sub['ArgumentMode'] == 'default') ? $sub['string_php'] :
            str_replace('$$FINAL', 'XML_val', $sub['php']);
    }
601723
def map_arg(**maps):
    
    def deco(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            if six.PY2:
                argmap = inspect.getcallargs(func, *args, **kwargs)
            else:
                # getcallargs was deprecated since 3.5
                sig = inspect.signature(func)
                argmap = sig.bind_partial(*args, **kwargs).arguments
            for k, map_func in six.iteritems(maps):
                if k in argmap:
                    argmap[k] = map_func(argmap[k])
            return func(**argmap)
        return wrapper
    return deco
1099305
def parse(self, arguments=None):
        
        arguments = self.arguments or arguments
        # FIXME: prep/normalize arguments in __init__
        # Split arguments if given as string and run the parser
        if isinstance(arguments, basestring):
            arguments = utils.split(arguments)

        # run the wrapped argparser command to gather user set arg values
        # FROM: https://docs.python.org/3/library/argparse.html
        # Sometimes a script may only parse a few of the command-line
        # arguments, passing the remaining arguments on to another script or
        # program.  In these cases, the parse_known_args() method can be
        # useful. It works much like parse_args() except that it does not
        # produce an error when extra arguments are present. Instead, it
        # returns a two item tuple containing the populated namespace and
        # the list of remaining argument strings.
        opts, _arguments = self.parser.parse_known_args(arguments)

        if not opts.config_file:
            opts.config_file = os.path.expanduser(DEFAULT_IDID_CONFIG)
        opts.config = Configuration().from_file(opts.config_file)
        # alias shortcut
        self.config = opts.config

        # if we're passing arguments in as a string we might get \n's or null
        # strings '' that we want to be sure to ignore
        _arguments = filter(
            lambda x: x if x else None, [_.strip() for _ in _arguments if _])

        # Now let the subclass parse the remaining special opts that
        # weren't consumed by default argparser
        opts = self._parse(opts, _arguments)

        return opts
1263550
def run_command(self, args):
        
        parsed_args = self.parser.parse_args(args)
        if hasattr(parsed_args, 'func'):
            parsed_args.func(parsed_args)
        else:
            self.parser.print_help()
113024
def split_function_call(tokens, loc):
    """"""
    pos_args = []
    star_args = []
    kwd_args = []
    dubstar_args = []
    for arg in tokens:
        argstr = "".join(arg)
        if len(arg) == 1:
            if star_args or kwd_args or dubstar_args:
                raise CoconutDeferredSyntaxError("positional arguments must come first", loc)
            pos_args.append(argstr)
        elif len(arg) == 2:
            if arg[0] == "*":
                if kwd_args or dubstar_args:
                    raise CoconutDeferredSyntaxError("star unpacking must come before keyword arguments", loc)
                star_args.append(argstr)
            elif arg[0] == "**":
                dubstar_args.append(argstr)
            else:
                kwd_args.append(argstr)
        else:
            raise CoconutInternalException("invalid function call argument", arg)
    return pos_args, star_args, kwd_args, dubstar_args
1115938
def call (*args)
      result = nil
      @components.each do |component|
        break if result and not @call_all
        result = component.send @message, *args
      end
      result
    end
309891
def evalsha(self, sha, numkeys, *keys_and_args):
        """"""
        if not self.script_exists(sha)[0]:
            raise RedisError("Sha not registered")
        script_callable = Script(self, self.shas[sha], self.load_lua_dependencies)
        numkeys = max(numkeys, 0)
        keys = keys_and_args[:numkeys]
        args = keys_and_args[numkeys:]
        return script_callable(keys, args)
68645
def call_method_with_optional_parameters(object, method_name, parameters)
        if object.respond_to?(method_name)
          if object.method(method_name).arity == -1
            object.send(method_name, parameters)
          else
            object.send(method_name)
          end
        end
      end
774473
def use_kwargs(self, *args, **kwargs) -> typing.Callable:
        
        return super().use_kwargs(*args, **kwargs)
1189943
def _eval_script(redis, script_id, *keys, **kwargs):
    
    args = kwargs.pop('args', ())
    if kwargs:
        raise TypeError("Unexpected keyword arguments %s" % kwargs.keys())
    try:
        return redis.evalsha(SCRIPTS[script_id], len(keys), *keys + args)
    except NoScriptError:
        logger.info("%s not cached.", SCRIPTS[script_id + 2])
        return redis.eval(SCRIPTS[script_id + 1], len(keys), *keys + args)
730462
def arg_parser(self, passed_args=None):
        
        parser, subpar, remaining_argv = self._setup_parser()
        if not isinstance(passed_args, list):
            passed_args = list()

        # Extend the passed args with the remaining parsed args
        if remaining_argv:
            passed_args.extend(remaining_argv)

        optional_args = self.arguments.get('optional_args')
        if optional_args:
            self._add_opt_argument(opt_args=optional_args, arg_parser=parser)

        subparsed_args = self.arguments.get('subparsed_args')
        if subparsed_args:
            for argument, value in subparsed_args.items():
                if 'optional_args' in value:
                    optional_args = value.pop('optional_args')
                else:
                    optional_args = dict()

                if 'shared_args' in value:
                    set_shared_args = self.arguments.get('shared_args')
                    _shared_args = value.pop('shared_args', list())
                    for shared_arg in _shared_args:
                        optional_args[shared_arg] = set_shared_args[shared_arg]

                action = subpar.add_parser(
                    argument,
                    **value
                )
                action.set_defaults(parsed_command=argument)

                if optional_args:
                    self._add_opt_argument(
                        opt_args=optional_args, arg_parser=action
                    )

        positional_args = self.arguments.get('positional_args')
        if positional_args:
            for argument in positional_args.keys():
                _arg = positional_args[argument]

                parser.add_argument(
                    argument,
                    **_arg
                )

        # Return the parsed arguments as a dict
        return vars(parser.parse_args(args=passed_args))
528002
def add_args(self, args):
        
        for key, value in vars(args).items():
            if value is not None:
                setattr(self, key.upper(), value)