from_mglcode