twig-clone is a Grav plugin to copy objects within clone templates, originally implemented for Drupal by @GroovyCarrot.
Allows you to copy an object (so as not to alter the original), from within your Twig template:
{% set attributes_copy = clone(attributes) %}
As this plugin has not been included in the Grav repositories yet, you have to install it manually.
From within your plugins directory:
git clone https://github.com/paulcmal/grav-plugin-twig-clone
mv grav-plugin-twig-clone twig-clone
This Twig extension was originally developped by @GroovyCarrot as a Drupal plugin.
I merely rewrapped his code as a Grav plugin.