def safe_move(src, dst):
    """Move file from src to dst.

    If file with same name already exists at dst, rename the new file
    while preserving the extension.

    Returns:
      path to new file.

    """
    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
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/docs/base.py/safe_move/operator `+` -> `/`