text: Title: add option to save generated code into file
  Body: I'm sorry if I missed this functionality, but `CLI` version hasn't it for sure (I saw the related code only in `generate_code_examples.py`). I guess it will be very useful to eliminate copy-paste phase, especially for large models.
  
  Of course, piping is a solution, but not for development in Jupyter Notebook, for example.