Cloning Elements
Very simple way to quickly replicate elements
With the .clone() method you can easily create new element that you can place in you tree and modify them.
The example below, takes a Uniform layer inside the compo and then create a copy of it. Then with this copy we can change its parameters, for example we change the label of the layer and the color generated by the Uniform :
from random import random
Original = script.parentElement.layers["Uniform"]
UniformClone = Original.clone()
UniformClone.label = "UniformCopy"
UniformClone.generator.color.blue.set(random())
script.parentElement.layers.append(UniformClone)