def METHOD_NAME(self, extra_params=None, params=None):
    def add_arg_formatted_param(_cmd_args, arg_format, _value):
        args = list(arg_format.to_text(_value))
        return _cmd_args + args
    def find_format(_param):
        return self.custom_formats.get(_param, self.module_formats.get(_param))
    extra_params = extra_params or dict()
    cmd_args = list([self.command]) if isinstance(self.command, str) else list(self.command)
    try:
        cmd_args[0] = self.module.get_bin_path(cmd_args[0], required=True)
    except ValueError:
        pass
    param_list = params if params else self.vars.keys()
    for param in param_list:
        if isinstance(param, dict):
            if len(param) != 1:
                self.do_raise("run_command parameter as a dict must contain only one key: {0}".format(param))
            _param = list(param.keys())[0]
            fmt = find_format(_param)
            value = param[_param]
        elif isinstance(param, str):
            if param in self.vars.keys():
                fmt = find_format(param)
                value = self.vars[param]
            elif param in extra_params:
                fmt = find_format(param)
                value = extra_params[param]
            else:
                self.do_raise('Cannot determine value for parameter: {0}'.format(param))
        else:
            self.do_raise("run_command parameter must be either a str or a dict: {0}".format(param))
        cmd_args = add_arg_formatted_param(cmd_args, fmt, value)
    return cmd_args