code: def __init__(self, path, data=None):
      self.path = str(path)  # convenience
      if data is None:
          if self.path.startswith("pkg:"):
              import pkgutil
  
              _, package, resource = self.path.split(":")
              content = pkgutil.get_data(package, resource)
              f = io.StringIO(content.decode("utf-8"))
          else:
              f = open(self.path)
          try:
              tokens = self._parse(iter(f))
          finally:
              f.close()
      else:
          tokens = self._parse(data.splitlines(True))
  
      self._sources = {}
      self.sections = {}
  
      for lineno, section, name, value in tokens:
          if section is None:
              self._raise(lineno, "no section header defined")
          self._sources[section, name] = lineno
          if name is None:
              if section in self.sections:
                  self._raise(
                      lineno, "duplicate section %r" % (section,)
                  )
              self.sections[section] = {}
          else:
              if name in self.sections[section]:
                  self._raise(lineno, "duplicate name %r" % (name,))
              self.sections[section][name] = value
  
imports: import io
label_desc: Use image node_id 1 to create a new IniConfig object from inherited base classes: object with example: obj = IniConfig(path, data)