code: def get_weight(self, weight=operator.attrgetter('weight')):
          
          return sum(weight(src) for src in self.get_sources())
docs: :param weight: source weight function
          :returns: total weight of the source model