code: def get_task_scfcycles(self, nids=None, wslice=None, task_class=None, exclude_ok_tasks=False):
          
          select_status = [self.S_RUN] if exclude_ok_tasks else [self.S_RUN, self.S_OK]
          tasks_cycles = []
  
          for task in self.select_tasks(nids=nids, wslice=wslice):
              # Fileter
              if task.status not in select_status or task.cycle_class is None:
                  continue
              if task_class is not None and not task.isinstance(task_class):
                  continue
              try:
                  cycle = task.cycle_class.from_file(task.output_file.path)
                  if cycle is not None:
                      tasks_cycles.append((task, cycle))
              except Exception:
                  # This is intentionally ignored because from_file can fail for several reasons.
                  pass
  
          return tasks_cycles
docs: Return list of (taks, scfcycle) tuples for all the tasks in the flow with a SCF algorithm
          e.g. electronic GS-SCF iteration, DFPT-SCF iterations etc.
  
          Args:
              nids: List of node identifiers.
              wslice: Slice object used to select works.
              task_class: String or class used to select tasks. Ignored if None.
              exclude_ok_tasks: True if only running tasks should be considered.
  
          Returns:
              List of `ScfCycle` subclass instances.