def run(self, args: dict, prev_stage_results: PREV_STAGE_RESULT = None) -> GATHERED_RESULTS:
        """Execute jobs sequentially and gather results.

        This method runs each job one at a time, collecting results and handling any
        failures that occur during execution.

        Args:
            args (dict): Arguments specific to the job. For example, if there is a
                pipeline defined where one of the job generators is hyperparameter
                optimization, then the pipeline configuration file will look something
                like:

                .. code-block:: yaml

                    arg1:
                    arg2:
                    hpo:
                        param1:
                        param2:
                        ...

                In this case, ``args`` will receive a dictionary with all keys under
                ``hpo``.

            prev_stage_results (PREV_STAGE_RESULT, optional): Results from the previous
                pipeline stage. Used when the current stage depends on previous results.
                Defaults to None.

        Returns:
            GATHERED_RESULTS: Combined results from all executed jobs.

        Raises:
            SerialExecutionError: If any job fails during execution.
        """
        results = []
        failures = False
        logger.info(f"Running job {self.generator.job_class.name}")
        for job in tqdm(self.generator(args, prev_stage_results), desc=self.generator.job_class.name):
            try:
                results.append(job.run())
            except Exception:  # noqa: PERF203
                failures = True
                logger.exception("Error running job.")
        gathered_result = self.generator.job_class.collect(results)
        self.generator.job_class.save(gathered_result)
        if failures:
            msg = f"There were some errors with job {self.generator.job_class.name}"
            print(msg)
            logger.error(msg)
            raise SerialExecutionError(msg)
        logger.info(f"Job {self.generator.job_class.name} completed successfully.")
        return gathered_result
Execute jobs sequentially and gather results.

        This method runs each job one at a time, collecting results and handling any
        failures that occur during execution.

        Args:
            args (dict): Arguments specific to the job. For example, if there is a
                pipeline defined where one of the job generators is hyperparameter
                optimization, then the pipeline configuration file will look something
                like:

                .. code-block:: yaml

                    arg1:
                    arg2:
                    hpo:
                        param1:
                        param2:
                        ...

                In this case, ``args`` will receive a dictionary with all keys under
                ``hpo``.

            prev_stage_results (PREV_STAGE_RESULT, optional): Results from the previous
                pipeline stage. Used when the current stage depends on previous results.
                Defaults to None.

        Returns:
            GATHERED_RESULTS: Combined results from all executed jobs.

        Raises:
            SerialExecutionError: If any job fails during execution.
        
src/anomalib/pipelines/components/runners/serial.py