def map_predict_voting(interface, state, label, inp):
    import decision_tree

    out = interface.output(0)
    fill_in_values = state["fill_in_values"]

    for row in inp:
        row = row.strip().split(state["delimiter"])
        predicted = False
        if len(row) > 1:
            x_id = "" if state["id_index"] == -1 else row[state["id_index"]]
            x = [(fill_in_values[j] if state["missing_vals"] in row[j] else float(row[j]) if state["X_meta"][
                                                                                                 i] == "c" else row[j])
                 for i, j in enumerate(state["X_indices"])]

            tallies = {}
            for tree in state["forest"]:
                pred = decision_tree.predict(tree, x)
                tallies[pred] = tallies.get(pred, 0) + 1
                if any(e > int(len(state["forest"]) / 2.) for e in tallies.values()):
                    prediction = max(tallies, key=tallies.get)
                    out.add(x_id, (prediction, tallies[prediction]))
                    predicted = True
                    break
            if not predicted:
                prediction = max(tallies, key=tallies.get)
                out.add(x_id, (prediction, tallies[prediction]))
dataset/ETHPy150Open romanorac/discomll/discomll/ensemble/distributed_random_forest.py/map_predict_voting/swapped operands of `in`