save_eim function

Save an eim object to a file