def safe_move(src, dst):
    new_dir = os.path.abspath(dst)
    ext = googlecl.get_extension_from_path(src)
    if not ext:
        dotted_ext = ''
    else:
        dotted_ext = '.' + ext
    filename = os.path.basename(src).rstrip(dotted_ext)
    rename_num = 1
    new_path = os.path.join(new_dir, filename + dotted_ext)
    while os.path.exists(new_path):
        new_filename = filename + '-' + str(rename_num) + dotted_ext
        new_path = os.path.join(new_dir, new_filename)
    shutil.move(src, new_path)
    return new_path
Callback that the tunnel is not accepted or is going down
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/docs/base.py/safe_move--crossover with--dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/calvincontrol.py/CalvinControlTunnelServer.tunnel_down