def calculate_merkle_pairs(bin_hashes, hash_function=bin_double_sha256):
    hashes = list(bin_hashes)
    # if there are an odd number of hashes, double up the last one
    if len(hashes) % 2 == 1:
        hashes.append(hashes[-1])
    # build the new list of hashes
    new_hashes = []
    for i in range(0, len(hashes), 2):
        new_hashes.append(hash_function(hashes[i] + hashes[i+1]))
    # return the new list of hashes
    return new_hashes
service: "service" indent "{" ( option | rpc | ";" )* "}"
dataset/ETHPy150Open blockstack/pybitcoin/pybitcoin/merkle.py/calculate_merkle_pairs--crossover with--dataset/ETHPy150Open Evgenus/protocyt/protocyt/compiler.py/CodeGenerator.on_service