Using python functions in ansbile

Hi
i wonder in which sittuations python functions can be used in templates, as i have found no infos on this in the documentation.
For example this works:

  • name: get some results
    shell: ls -lrt
    register: shell_res

  • name: process shell res
    debug: msg=“{{item}}”
    with_items: “{{shell_res.stdout.split(‘\n’)}}”

so the split function is available here.
Where too?
Whereelse not?

Thanks
Best Regards
Bernhard