Whenever you are using a code editor in Divi, you will notice some icons at the top of the interface. You can use them to save code to your library, add code from your library, or import and export code to and from the code editor. It works like just the Divi Layouts Library and the Divi Theme Builder Library.