def _copy_file(self, source, dest):
        source = self._absnorm(source)
        dest = dest.replace('/', os.sep)
        dest_is_dir = dest.endswith(os.sep)
        dest = self._absnorm(dest)
        if not os.path.exists(source):
            raise RuntimeError("Source file '%s' does not exist" % source)
        if not os.path.isfile(source):
            raise RuntimeError("Source file '%s' is not a regular file" % source)
        if not os.path.exists(dest):
            if dest_is_dir:
                parent = dest
            else:
                parent = os.path.dirname(dest)
            if not os.path.exists(parent):
                os.makedirs(parent)
        shutil.copy(source, dest)
        return source, dest
dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/libraries/OperatingSystem.py/OperatingSystem._copy_file/original