def render_template(cmd_derived_from_alias, pos_args_table):
    """
    Render cmd_derived_from_alias as a Jinja template with pos_args_table as the arguments.

    Args:
        cmd_derived_from_alias: The string to be injected with positional arguemnts.
        pos_args_table: The dictionary used to rendered.

    Returns:
        A processed string with positional arguments injected.
    """
    try:
        cmd_derived_from_alias = normalize_placeholders(cmd_derived_from_alias, inject_quotes=True)
        template = jinja.Template(cmd_derived_from_alias)

        # Shlex.split allows us to split a string by spaces while preserving quoted substrings
        # (positional arguments in this case)
        rendered = shlex.split(template.render(pos_args_table))

        # Manually check if there is any runtime error (such as index out of range)
        # since Jinja template engine only checks for compile time error.
        # Only check for runtime errors if there is an empty string in rendered.
        if '' in rendered:
            check_runtime_errors(cmd_derived_from_alias, pos_args_table)

        return rendered
    except Exception as exception:
        # Exception raised from runtime error
        if isinstance(exception, CLIError):
            raise

        # The template has some sort of compile time errors
        split_exception_message = str(exception).split()

        # Check if the error message provides the index of the erroneous character
        error_index = split_exception_message[-1]
        if error_index.isdigit():
            split_exception_message.insert(-1, 'index')
            error_msg = RENDER_TEMPLATE_ERROR.format(' '.join(split_exception_message), cmd_derived_from_alias)

            # Calculate where to put an arrow (^) char so that it is exactly below the erroneous character
            # e.g. ... "{{a.split('|)}}"
            #                       ^
            error_msg += '\n{}^'.format(' ' * (len(error_msg) - len(cmd_derived_from_alias) + int(error_index) - 1))
        else:
            exception_str = str(exception).replace('"{{', '}}').replace('}}"', '}}')
            error_msg = RENDER_TEMPLATE_ERROR.format(cmd_derived_from_alias, exception_str)

        raise CLIError(error_msg)
Render cmd_derived_from_alias as a Jinja template with pos_args_table as the arguments.

    Args:
        cmd_derived_from_alias: The string to be injected with positional arguemnts.
        pos_args_table: The dictionary used to rendered.

    Returns:
        A processed string with positional arguments injected.