You can now control your Instance state from the python library. Please note that this is available on for segmind==0.1.9 versions and later. Run !pip install segmind==0.1.9 to upgrade your pip package version.
Use this to programmatically stop your instance once your code has been executed. You should call this at the end of your script.
id is optional and can be passed when running it from outside segmind instances.
Note that CLI option is not available for instance.stop yet and is in the development pipeline.