code: def sections(self, kind=None):
          
          result = []
          for section in self.parser.sections():
              # Selected kind only if provided
              if kind is not None:
                  try:
                      section_type = self.parser.get(section, "type")
                      if section_type != kind:
                          continue
                  except NoOptionError:
                      continue
              result.append(section)
          return result
docs: Return all sections (optionally of given kind only)