def parse(self):
        _config = self.read_config(self.config)
        for src, path, configsection, key, value in _config:
            if ':' in configsection:
                sectiongroupname, sectionname = configsection.split(':')
            else:
                sectiongroupname, sectionname = 'global', configsection
            if sectiongroupname == 'global' and sectionname == 'global' and key == 'extends':
                continue
            sectiongroup = self.setdefault(sectiongroupname, ConfigSection())
            self.get_section(sectiongroupname, sectionname)
            if key is not None:
                if key == 'massagers':
                    for spec in value.splitlines():
                        spec = spec.strip()
                        if not spec:
                            continue
                        if '=' not in spec:
                            log.error("Invalid massager spec '%s' in section '%s:%s'.", spec, sectiongroupname, sectionname)
                            sys.exit(1)
                        massager_key, massager = spec.split('=')
                        massager_key = massager_key.strip()
                        massager = massager.strip()
                        if ':' in massager_key:
                            parts = tuple(x.strip() for x in massager_key.split(':'))
                            if len(parts) == 2:
                                massager_sectiongroupname, massager_key = parts
                                massager_sectionname = None
                            elif len(parts) == 3:
                                massager_sectiongroupname, massager_sectionname, massager_key = parts
                            else:
                                log.error("Invalid massager spec '%s' in section '%s:%s'.", spec, sectiongroupname, sectionname)
                                sys.exit(1)
                            if massager_sectiongroupname == '':
                                massager_sectiongroupname = sectiongroupname
                            if massager_sectiongroupname == '*':
                                massager_sectiongroupname = None
                            if massager_sectionname == '':
                                massager_sectionname = sectionname
                        else:
                            massager_sectiongroupname = sectiongroupname
                            massager_sectionname = sectionname
                        try:
                            massager = resolve_dotted_name(massager)
                        except ImportError as e:
                            log.error("Can't import massager from '%s'.\n%s", massager, unicode(e))
                            sys.exit(1)
                        except __HOLE__ as e:
                            log.error("Can't import massager from '%s'.\n%s", massager, unicode(e))
                            sys.exit(1)
                        massager = massager(massager_sectiongroupname, massager_key)
                        if massager_sectionname is None:
                            self.add_massager(massager)
                        else:
                            massager_section = self.get_section(
                                sectiongroupname, massager_sectionname)
                            massager_section.add_massager(massager)
                else:
                    sectiongroup[sectionname][key] = ConfigValue(path, value, src=src)
        if 'plugin' in self:  # pragma: no cover
            warnings.warn("The 'plugin' section isn't used anymore.")
            del self['plugin']
        seen = set()
        for sectiongroupname in self:
            sectiongroup = self[sectiongroupname]
            for sectionname in sectiongroup:
                section = sectiongroup[sectionname]
                if '<' in section:
                    self._expand(sectiongroupname, sectionname, section, seen)
        return self
dataset/ETHPy150Open ployground/ploy/ploy/config.py/Config.parse