def get_destination_path(path, to, keep_dirs):
 filename = os.path.basename(path)
 if keep_dirs:
  path_suffix = path
 else:
  path_suffix = filename
 return os.path.join(to, path_suffix)

def get_destination_path ( path , to , keep_dirs ) : filename = os . path . basename ( path ) if keep_dirs : path_suffix = path else : path_suffix = filename return os . path . join ( to , path_suffix )
generate the destination path for a given file .