
def grab_shape(element, shape_name):
    return element.Shapes(shape_name)

def grab_styles(shape):
    return {'width':  shape.Width,
            'height': shape.Height,
            'top':    shape.Top,
            'left':   shape.Left}

def apply_styles(shape, styles):
    shape.Top    = styles['top']
    shape.Left   = styles['left']
    shape.Height = styles['height']
    shape.Width  = styles['width']

def replace_text(label_shape, content):
    label_shape.TextFrame.TextRange.Text = content

@@ -9,23 +9,21 @@
 b_shape(
-element
+slide
 , shape_
@@ -44,15 +44,13 @@
 urn 
-element
+slide
 .Sha
@@ -230,43 +230,155 @@
 Left
-%7D%0A%0Adef apply_styles(shape, styles):
+,%0A            'lock_aspect_ratio': shape.LockAspectRatio%7D%0A%0Adef apply_styles(shape, styles):%0A    shape.LockAspectRatio = styles%5B'lock_aspect_ratio'%5D
 %0A   
@@ -604,8 +604,520 @@
 content%0A
+%0Adef transfer_properties(from_shape, to_shape):%0A    apply_styles(to_shape, grab_styles(from_shape))%0A    name = from_shape.Name%0A    from_shape.Delete()%0A    to_shape.Name = name%0A%0Adef insert_image(slide, shape_name, filename, w = 4, h = 4):%0A    picture = slide.Shapes.AddPicture(filename, 1, 1, w, h)%0A    placeholder = grab_shape(slide, shape_name)%0A    transfer_properties(placeholder, picture)%0A%0Adef flatten(x):%0A    if type(x) is list:%0A        return %5Ba for i in x for a in flatten(i)%5D%0A    else:%0A        return %5Bx%5D%0A

Add flatten and image inser utils