def get_run_id_keys(json_results, run_id_list):
    """This function finds the key used in the json_results dictionary
    for a given run ID. These dictionary keys are the files names and
    there are potentially many keys that are associated with a run ID.
    For the intended purposes of this function (metadata comparison),
    any file associated with the run ID will have the same metadata as
    any other file associated with the run ID; it doesn't matter which
    one we use.

    Args:
        json_results (dict) - benchmark results
        run_id_list (list) - List of strings of the run-IDs being compared

    Returns:
        run_id_keys (dict) - Dictionary relating run-IDs (five character
        unique IDs) and the key for said run ID in the json_results
        dictionary.
    """
    run_id_keys = {}
    for run_id in run_id_list:
        for key in json_results:
            if run_id in key:
                if run_id not in run_id_keys:
                    run_id_keys[run_id] = key
                    break
    return run_id_keys