def METHOD_NAME(self, done, pending):
    """
    Process the finished and pendings tasks and return error output and an exit code.
    This function is used by _run_processes() to generate the final stdout to be printed
    (which is going to be the output of the failed tasks since the cancelled tasks and
    successful tasks already had their output printed) and an exit code that bodhi-ci
    should use. Any pending tasks will be cancelled.
    Args:
        done (set): A set of asyncio.Tasks that represent finished tasks.
        pending (set): A set of asyncio.Tasks that represent unfinished tasks.
            These will be canceled.
    Returns:
        dict: A dictionary with two keys:
            'error_output': The error output that should be printed.
            'returncode': The exit code that bodhi-ci should exit with.
    """
    returncode = 0
    error_output = ''
    if pending:
        for task in pending:
            task.cancel()
        future = asyncio.wait(pending)
        cancelled, pending = self.loop.run_until_complete(future)
        done = done | cancelled
        returncode = -signal.SIGINT
    for task in done:
        try:
            result = task.result()
        except RuntimeError as e:
            result = e.result
        if not result.cancelled and result.returncode:
            if result.output:
                error_output = f'{error_output}\n{result.output}'
            if not returncode:
                returncode = result.returncode
    return {'error_output': error_output, 'returncode': returncode}