Apply theme to group via code?

Is it possible to apply a theme export (or a theme from another group) to a new group via code?

I have a group that is customize with page layouts and widgets, but it is not using the Default Group theme.  I would like to take that same configuration and apply it to several new groups as they are created.