code: def export_into_python(self):
          
          pkl_path = self.model.name + '.pkl'
          with open(pkl_path, 'wb') as fh:
              pickle.dump(self, fh, protocol=2)
          py_str = """
          import pickle
          with open('%s', 'rb') as fh:
              model_class = pickle.load(fh)
          """ % os.path.abspath(pkl_path)
          py_str = textwrap.dedent(py_str)
          py_path = self.model.name + '.py'
          with open(py_path, 'w') as fh:
              fh.write(py_str)
docs: Write the model into a pickle and create a module that loads it.
  
          The model basically exports itself as a pickle file and a Python
          file is then written which loads the pickle file. This allows importing
          the model in the simulation workflow.