def render_complex(value: Any, variables: TemplateVarsType=None, limited: bool=False) -> Any:
    'Recursive template creator helper function.'
    if isinstance(value, list):
        return [render_complex(item, variables) for item in value]
    if isinstance(value, collections.abc.Mapping):
        return {render_complex(key, variables): render_complex(item, variables) for (key, item) in value.items()}
    if isinstance(value, Template):
        return value.async_render(variables, limited=limited)
    return value
Recursive template creator helper function.
def render_complex(value: Any, variables: TemplateVarsType=None, limited: bool=False) -> Any:
    
    if isinstance(value, list):
        return [render_complex(item, variables) for item in value]
    if isinstance(value, collections.abc.Mapping):
        return {render_complex(key, variables): render_complex(item, variables) for (key, item) in value.items()}
    if isinstance(value, Template):
        return value.async_render(variables, limited=limited)
    return value