@permittedKwargs(permitted_kwargs['run_target'])
def func_run_target(self, node, args, kwargs):
    if (len(args) > 1):
        raise InvalidCode('Run_target takes only one positional argument: the target name.')
    elif (len(args) == 1):
        if ('command' not in kwargs):
            raise InterpreterException('Missing "command" keyword argument')
        all_args = extract_as_list(kwargs, 'command')
        deps = unholder(extract_as_list(kwargs, 'depends'))
    else:
        raise InterpreterException('Run_target needs at least one positional argument.')
    cleaned_args = []
    for i in unholder(listify(all_args)):
        if (not isinstance(i, (str, build.BuildTarget, build.CustomTarget, dependencies.ExternalProgram, mesonlib.File))):
            mlog.debug('Wrong type:', str(i))
            raise InterpreterException('Invalid argument to run_target.')
        if (isinstance(i, dependencies.ExternalProgram) and (not i.found())):
            raise InterpreterException('Tried to use non-existing executable {!r}'.format(i.name))
        cleaned_args.append(i)
    name = args[0]
    if (not isinstance(name, str)):
        raise InterpreterException('First argument must be a string.')
    cleaned_deps = []
    for d in deps:
        if (not isinstance(d, (build.BuildTarget, build.CustomTarget))):
            raise InterpreterException('Depends items must be build targets.')
        cleaned_deps.append(d)
    (command, *cmd_args) = cleaned_args
    tg = RunTargetHolder(build.RunTarget(name, command, cmd_args, cleaned_deps, self.subdir, self.subproject), self)
    self.add_target(name, tg.held_object)
    full_name = (self.subproject, name)
    assert (full_name not in self.build.run_target_names)
    self.build.run_target_names.add(full_name)
    return tg
@permittedKwargs(permitted_kwargs['run_target'])
def func_run_target(self, node, args, kwargs):
    if (len(args) > 1):
        raise InvalidCode('Run_target takes only one positional argument: the target name.')
    elif (len(args) == 1):
        if ('command' not in kwargs):
            raise InterpreterException('Missing "command" keyword argument')
        all_args = extract_as_list(kwargs, 'command')
        deps = unholder(extract_as_list(kwargs, 'depends'))
    else:
        raise InterpreterException('Run_target needs at least one positional argument.')
    cleaned_args = []
    for i in unholder(listify(all_args)):
        if (not isinstance(i, (str, build.BuildTarget, build.CustomTarget, dependencies.ExternalProgram, mesonlib.File))):
            mlog.debug('Wrong type:', str(i))
            raise InterpreterException('Invalid argument to run_target.')
        if (isinstance(i, dependencies.ExternalProgram) and (not i.found())):
            raise InterpreterException('Tried to use non-existing executable {!r}'.format(i.name))
        cleaned_args.append(i)
    name = args[0]
    if (not isinstance(name, str)):
        raise InterpreterException('First argument must be a string.')
    cleaned_deps = []
    for d in deps:
        if (not isinstance(d, (build.BuildTarget, build.CustomTarget))):
            raise InterpreterException('Depends items must be build targets.')
        cleaned_deps.append(d)
    (command, *cmd_args) = cleaned_args
    tg = RunTargetHolder(build.RunTarget(name, command, cmd_args, cleaned_deps, self.subdir, self.subproject), self)
    self.add_target(name, tg.held_object)
    full_name = (self.subproject, name)
    assert (full_name not in self.build.run_target_names)
    self.build.run_target_names.add(full_name)
    return tg