code: def _par_write(self, dirname):
          
          filename = dirname + '/' + 'template_parameters.csv'
          with open(filename, 'w') as parfile:
              for template in self.templates:
                  for key in template.__dict__.keys():
                      if key not in ['st', 'event']:
                          parfile.write(key + ': ' +
                                        str(template.__dict__[key]) + ', ')
                  parfile.write('\n')
          return self
docs: Internal write function to write a formatted parameter file.
  
          :type dirname: str
          :param dirname: Directory to write the parameter file to.