'Copies the source file into the destination.
Source must be an existing file. Starting from Robot Framework 2.8.4,
it can be given as a glob pattern (see `Pattern matching`) that matches
exactly one file. How the destination is interpreted is explained below.
1) If the destination is an existing file, the source file is copied
over it.
2) If the destination is an existing directory, the source file is
copied into it. A possible file with the same name as the source is
overwritten.
3) If the destination does not exist and it ends with a path
separator (``/`` or ``\``), it is considered a directory. That
directory is created and a source file copied into it.
Possible missing intermediate directories are also created.
4) If the destination does not exist and it does not end with a path
separator, it is considered a file. If the path to the file does not
exist, it is created.
The resulting destination path is returned since Robot Framework 2.9.2.
See also `Copy Files`, `Move File`, and `Move Files`.'

def copy_file(self, source, destination):

    (source, destination) = self._prepare_copy_and_move_file(source, destination)
    if (not self._are_source_and_destination_same_file(source, destination)):
        (source, destination) = self._atomic_copy(source, destination)
        self._link("Copied    file    from    '%s'    to    '%s'.", source, destination)
    return destination
