<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _sanitize_data(runnable_jobs_data):
 """We receive data from runnable jobs api and return the sanitized data that meets our needs. This is a loop to remove duplicates (including buildsystem -> * transformations if needed) By doing this, it allows us to have a single database query It returns sanitized_list which will contain a subset which excludes: * jobs that don't specify the platform * jobs that don't specify the testtype * if the job appears again, we replace build_system_type with '*'. By doing so, if a job appears under both 'buildbot' and 'taskcluster', its build_system_type will be '*' """

    job_build_system_type = {}
    sanitized_list = []
    for job in runnable_jobs_data:
        if not valid_platform(job['platform']):
            logger.info('Invalid platform %s', job['platform'])
            continue

        testtype = parse_testtype(
            build_system_type=job['build_system_type'],
            job_type_name=job['job_type_name'],
            platform_option=job['platform_option'],
            ref_data_name=job['ref_data_name']
        )

        if not testtype:
            continue

        # NOTE: This is *all* the data we need from the runnable API
        new_job = {
            'build_system_type': job['build_system_type'],  # e.g. {buildbot,taskcluster,*}
            'platform': job['platform'],  # e.g. windows8-64
            'platform_option': job['platform_option'],  # e.g. {opt,debug}
            'testtype': testtype,  # e.g. web-platform-tests-1
        }
        key = _unique_key(new_job)

        # Let's build a map of all the jobs and if duplicated change the build_system_type to *
        if key not in job_build_system_type:
            job_build_system_type[key] = job['build_system_type']
            sanitized_list.append(new_job)
        elif new_job['build_system_type'] != job_build_system_type[key]:
            new_job['build_system_type'] = job_build_system_type[key]
            # This will *replace* the previous build system type with '*'
            # This guarantees that we don't have duplicates
            sanitized_list[sanitized_list.index(new_job)]['build_system_type'] = '*'

    return sanitized_list