code: def is_finalizable(self):
          
  
          composite_state = self.dependent_on_composite_state()
          if not composite_state.all_finished:
              return False
  
          if self.job_record is None:
              self.tree.timetable.assign_job_record(self)
  
          children_processed = all([child.job_record.is_finished for child in self.children.values()])
  
          return children_processed and self.job_record.is_active
docs: method checks whether:
           - all counterpart of this node in dependent_on trees are finished
           - all direct children of the node are finished
           - the node itself is in active state