def most_recently_run_condition_info(conn, cond_names, successful_only=False):
    'For a list of condition names, return a dict of cond_name -> (run_id, cond_config) for the most recent results.\n\n    If a particular condition has never completed successfully, the value of the dict will be None, unless the\n    successful_only parameter is set to True, in which case the key will not exist in the returned dict.\n    '
    conditions_to_find = copy.copy(cond_names)
    rv = {}
    job_metadata_list = metadata.query_for_command_runs(conn, 'dirbs-classify')
    for job_metadata in job_metadata_list:
        extra_metadata = job_metadata.extra_metadata
        metadata_conditions = extra_metadata.get('conditions', {})
        matched_imei_counts = extra_metadata.get('matched_imei_counts', {})
        conditions_lookup = {c['label']: c for c in metadata_conditions}
        for req_cond_name in copy.copy(conditions_to_find):
            if (req_cond_name in matched_imei_counts):
                rv[req_cond_name] = {'run_id': job_metadata.run_id, 'config': conditions_lookup[req_cond_name], 'last_successful_run': job_metadata.start_time}
                conditions_to_find.remove(req_cond_name)
    if (not successful_only):
        for missing_cond_name in conditions_to_find:
            rv[missing_cond_name] = None
    return rv
For a list of condition names, return a dict of cond_name -> (run_id, cond_config) for the most recent results.

If a particular condition has never completed successfully, the value of the dict will be None, unless the
successful_only parameter is set to True, in which case the key will not exist in the returned dict.
def most_recently_run_condition_info(conn, cond_names, successful_only=False):
    'For a list of condition names, return a dict of cond_name -> (run_id, cond_config) for the most recent results.\n\n    If a particular condition has never completed successfully, the value of the dict will be None, unless the\n    successful_only parameter is set to True, in which case the key will not exist in the returned dict.\n    '
    conditions_to_find = copy.copy(cond_names)
    rv = {}
    job_metadata_list = metadata.query_for_command_runs(conn, 'dirbs-classify')
    for job_metadata in job_metadata_list:
        extra_metadata = job_metadata.extra_metadata
        metadata_conditions = extra_metadata.get('conditions', {})
        matched_imei_counts = extra_metadata.get('matched_imei_counts', {})
        conditions_lookup = {c['label']: c for c in metadata_conditions}
        for req_cond_name in copy.copy(conditions_to_find):
            if (req_cond_name in matched_imei_counts):
                rv[req_cond_name] = {'run_id': job_metadata.run_id, 'config': conditions_lookup[req_cond_name], 'last_successful_run': job_metadata.start_time}
                conditions_to_find.remove(req_cond_name)
    if (not successful_only):
        for missing_cond_name in conditions_to_find:
            rv[missing_cond_name] = None
    return rv