code: def parse_extends(self):
          for _selectors, rules in self.parts.items():
              if ' extends ' in _selectors:
                  selectors, _, parent = _selectors.partition(' extends ')
                  parents = parent.split('&')
                  del self.parts[_selectors]
                  for parent in parents:
                      new_selectors = selectors + ' extends ' + parent
                      self.parts.setdefault(new_selectors, [])
                      self.parts[new_selectors].extend(rules)
                      rules = []
          cnt = 0
          parents_left = True
          while parents_left and cnt < 10:
              cnt += 1
              parents_left = False
              for _selectors in self.parts.keys():
                  selectors, _, parent = _selectors.partition(' extends ')
                  if parent:
                      parents_left = True
                      if _selectors not in self.parts:
                          continue
                      rules = self.parts[_selectors]
                      del self.parts[_selectors]
                      self.parts.setdefault(selectors, [])
                      self.parts[selectors].extend(rules)
                      parents = self.link_with_parents(parent, selectors, rules)
                      if parents is None:
                          log.warn("Parent rule not found: %s", parent)
                      else:
                          new_context = {}
                          new_options = {}
                          for parent in parents:
                              new_context.update(parent[CONTEXT])
                              new_options.update(parent[OPTIONS])
                          for rule in rules:
                              _new_context = new_context.copy()
                              _new_context.update(rule[CONTEXT])
                              rule[CONTEXT] = _new_context
                              _new_options = new_options.copy()
                              _new_options.update(rule[OPTIONS])
                              rule[OPTIONS] = _new_options