code: def set_duration(self, duration):
          
          fixed = sum(int(x.get('time', 0)) for x in self.slides)
  
          nfixed = len([x for x in self.slides if x.get('time', 0) > 0])
  
          unfixed = len(self.slides) - nfixed
  
          self.wait = max(1, int(duration / unfixed))
docs: Calculate how long each slide should show