nodes: 0, module; 1, function_definition; 2, function_name:write_csv; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, comment:# Sort the Sections; 9, expression_statement; 10, comment:# Sort Terms in the root section; 11, comment:# Re-wrap the description and abstract; 12, if_statement; 13, if_statement; 14, expression_statement; 15, expression_statement; 16, expression_statement; 17, return_statement; 18, identifier:path; 19, None; 20, comment:"""Write CSV file. Sorts the sections before calling the superclass write_csv"""; 21, call; 22, attribute; 23, block; 24, attribute; 25, block; 26, assignment; 27, assignment; 28, call; 29, call; 30, attribute; 31, argument_list; 32, identifier:self; 33, identifier:description; 34, expression_statement; 35, identifier:self; 36, identifier:abstract; 37, expression_statement; 38, identifier:t; 39, call; 40, attribute; 41, call; 42, attribute; 43, argument_list; 44, attribute; 45, argument_list; 46, identifier:self; 47, identifier:sort_sections; 48, list; 49, assignment; 50, assignment; 51, attribute; 52, argument_list; 53, identifier:t; 54, identifier:value; 55, identifier:datetime_now; 56, argument_list; 57, identifier:self; 58, identifier:sort_by_term; 59, call; 60, identifier:write_csv; 61, call; 62, string; 63, string; 64, string; 65, string; 66, string; 67, string; 68, string; 69, attribute; 70, attribute; 71, attribute; 72, attribute; 73, subscript; 74, identifier:get_or_new_term; 75, string; 76, identifier:super; 77, argument_list; 78, identifier:str; 79, argument_list; 80, string_content:Root; 81, string_content:Contacts; 82, string_content:Documentation; 83, string_content:References; 84, string_content:Resources; 85, string_content:Citations; 86, string_content:Schema; 87, identifier:self; 88, identifier:description; 89, identifier:self; 90, identifier:description; 91, identifier:self; 92, identifier:description; 93, identifier:self; 94, identifier:abstract; 95, identifier:self; 96, string; 97, string_content:Root.Modified; 98, identifier:path; 99, string_content:Root
code: def write_csv(self, path=None):
          """Write CSV file. Sorts the sections before calling the superclass write_csv"""
  
          # Sort the Sections
  
          self.sort_sections(['Root', 'Contacts', 'Documentation', 'References', 'Resources', 'Citations', 'Schema'])
  
          # Sort Terms in the root section
  
          # Re-wrap the description and abstract
          if self.description:
              self.description = self.description
  
          if self.abstract:
              self.description = self.abstract
  
          t = self['Root'].get_or_new_term('Root.Modified')
          t.value = datetime_now()
  
          self.sort_by_term()
  
          return super().write_csv(str(path))