Perspective JSON as parameter for script

This code creates a deepcopy (the correct way):

If you put it in a project script it should be easyenough to use

	def sanitize_tree(element):
		    if hasattr(element, '__iter__'):
		        if hasattr(element, 'keys'):
		            return dict((k, sanitize_tree(element[k])) for k in element.keys())
		        else:
		            return list(sanitize_tree(x) for x in element)
		    return element
		    
	obj = sanitize_tree(self.view.custom.test)
			
	obj['val_1']['index'] +=1
	obj['val_1']['index'] +=1
	obj['val_1']['index'] +=1
	obj['val_1']['index'] +=1
	obj['val_1']['index'] +=1
	
	self.view.custom.test = obj