def main():
    'Command line:\n    python result_eval.py <path_to_reference_file> <path_to_candidate_file>\n    '
    if (len(sys.argv) == 3):
        path_to_reference = sys.argv[1]
        path_to_candidate = sys.argv[2]
    else:
        print('Usage: result_eval.py <reference ranking> <candidate ranking>')
        exit()
    metrics = compute_metrics_from_files(path_to_reference, path_to_candidate)
    result = dict()
    for metric in sorted(metrics):
        result[metric] = metrics[metric]
    result_json = json.dumps(result)
    print(result_json)
Command line:
python result_eval.py <path_to_reference_file> <path_to_candidate_file>
def main():
    'Command line:\n    python result_eval.py <path_to_reference_file> <path_to_candidate_file>\n    '
    if (len(sys.argv) == 3):
        path_to_reference = sys.argv[1]
        path_to_candidate = sys.argv[2]
    else:
        print('Usage: result_eval.py <reference ranking> <candidate ranking>')
        exit()
    metrics = compute_metrics_from_files(path_to_reference, path_to_candidate)
    result = dict()
    for metric in sorted(metrics):
        result[metric] = metrics[metric]
    result_json = json.dumps(result)
    print(result_json)