def getShapeLayer(chunk, label): for layer in chunk.shapes.groups: if layer.label == label: return layer print("Label not found") return None