def METHOD_NAME(wires, joinAttempts = 0):
    """join_wires(objects): merges a set of wires where possible, if any of those
    wires have a coincident start and end point"""
    if joinAttempts > len(wires):
        return
    joinAttempts += 1
    for wire1Index, wire1 in enumerate(wires):
        for wire2Index, wire2 in enumerate(wires):
            if wire2Index <= wire1Index:
                continue
            if join_two_wires(wire1, wire2):
                wires.pop(wire2Index)
                break
    METHOD_NAME(wires, joinAttempts)