message: Add api documentation for `tf.io.gfile.copy`.
diff: @@ -500,25 +500,61 @@ def recursive_create_dir_v2(path):
  _pywrap_file_io.RecursivelyCreateDir(compat.path_to_bytes(path))
  -@tf_export(v1=["gfile.Copy"])
  -def copy(oldpath, newpath, overwrite=False):
  - """Copies data from `oldpath` to `newpath`.
  +@tf_export("io.gfile.copy")
  +def copy_v2(src, dst, overwrite=False):
  + """Copies data from `src` to `dst`.
  - Args:
  - oldpath: string, name of the file who's contents need to be copied
  - newpath: string, name of the file to which to copy to
  - overwrite: boolean, if false it's an error for `newpath` to be occupied by
  - an existing file.
  + >>> with open("/tmp/x", "w") as f:
  + ... f.write("asdf")
  + ...
  + 4
  + >>> tf.io.gfile.exists("/tmp/x")
  + True
  + >>> tf.io.gfile.copy("/tmp/x", "/tmp/y")
  + >>> tf.io.gfile.exists("/tmp/y")
  + True
  + >>> tf.io.gfile.remove("/tmp/y")
  - Raises:
  - errors.OpError: If the operation fails.
  - """
  - copy_v2(oldpath, newpath, overwrite)
  + You can also specify the URI scheme for selecting a different filesystem:
  +
  + >>> with open("/tmp/x", "w") as f:
  + ... f.write("asdf")
  + ...
  + 4
  + >>> tf.io.gfile.copy("/tmp/x", "file:///tmp/y")
  + >>> tf.io.gfile.exists("/tmp/y")
  + True
  + >>> tf.io.gfile.remove("/tmp/y")
  + Note that you need to always specify a file name, even if moving into a new
  + directory. This is because some cloud filesystems don't have the concept of a
  + directory.
  -@tf_export("io.gfile.copy")
  -def copy_v2(src, dst, overwrite=False):
  - """Copies data from `src` to `dst`.
  + >>> with open("/tmp/x", "w") as f:
  + ... f.write("asdf")
  + ...
  + 4
  + >>> tf.io.gfile.mkdir("/tmp/new_dir")
  + >>> tf.io.gfile.copy("/tmp/x", "/tmp/new_dir/y")
  + >>> tf.io.gfile.exists("/tmp/new_dir/y")
  + True
  + >>> tf.io.gfile.rmtree("/tmp/new_dir")
  +
  + If you want to prevent errors if the path already exists, you can use
  + `overwrite` argument:
  +
  + >>> with open("/tmp/x", "w") as f:
  + ... f.write("asdf")
  + ...
  + 4
  + >>> tf.io.gfile.copy("/tmp/x", "file:///tmp/y")
  + >>> tf.io.gfile.copy("/tmp/x", "file:///tmp/y", overwrite=True)
  + >>> tf.io.gfile.remove("/tmp/y")
  +
  + Note that the above will still result in an error if you try to overwrite a
  + directory with a file.
  +
  + Note that you cannot copy a directory, only file arguments are supported.
  Args:
  src: string, name of the file whose contents need to be copied
  @@ -533,6 +569,14 @@ def copy_v2(src, dst, overwrite=False):
  compat.path_to_bytes(src), compat.path_to_bytes(dst), overwrite)
  +@tf_export(v1=["gfile.Copy"])
  +def copy(oldpath, newpath, overwrite=False):
  + copy_v2(oldpath, newpath, overwrite)
  +
  +
  +copy.__doc__ = copy_v2.__doc__
  +
  +
  @tf_export(v1=["gfile.Rename"])
  def rename(oldname, newname, overwrite=False):
  """Rename or move a file / directory.
  