<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_sacct(sacct_jobs: List[dict], jobs_count: int=None):
 """Parse out info from Sacct log."""

        failed_jobs = sacct_api.filter_jobs(sacct_jobs, failed=True)
        completed_jobs = [job for job in sacct_jobs if job['is_completed']]
        last_job_end = completed_jobs[-1]['end'] if len(completed_jobs) > 0 else None
        data = {
            'jobs': jobs_count,
            'completed_jobs': len(completed_jobs),
            'progress': (len(completed_jobs) / jobs_count) if jobs_count else None,
            'failed_jobs': [{
                'slurm_id': job['id'],
                'started_at': job['start'],
                'elapsed': job['elapsed'],
                'status': job['state'].lower(),
                'name': job['step'],
                'context': job['context'],
            } for job in failed_jobs]
        }
        return data, last_job_end