Move ``value`` from set ``src`` to set ``dst`` atomically

        Cluster impl:
            SMEMBERS --> SREM --> SADD. Function is no longer atomic.
327348
async def smove(self, src, dst, value):
        
        res = await self.srem(src, value)

        # Only add the element if existed in src set
        if res == 1:
            await self.sadd(dst, value)

        return res
748583
def rename(self, paths, dst):
        ''' 
        '''
        if not isinstance(paths, list):
            raise InvalidInputException("Paths should be a list")
        if not paths:
            raise InvalidInputException("rename: no path given")
        if not dst:
            raise InvalidInputException("rename: no destination given")

        processor = lambda path, node, dst=dst: self._handle_rename(path, node, dst)
        for item in self._find_items(paths, processor, include_toplevel=True):
            if item:
                yield item
142143
function (target, src) {
    var array = Array.isArray(src);
    var dst = array && [] || {};

    if (array) {
      target = target || [];
      dst = dst.concat(target);
      src.forEach(function(e, i) {
        if (typeof dst[i] === 'undefined') {
          dst[i] = e;
        } else if (typeof e === 'object') {
          dst[i] = Utils.merge(target[i], e);
        } else {
          if (target.indexOf(e) === -1) {
            dst.push(e);
          }
        }
      });
    } else {
      if (target && typeof target === 'object') {
        Object.keys(target).forEach(function (key) {
          dst[key] = target[key];
        })
      }
      Object.keys(src).forEach(function (key) {
        if (typeof src[key] !== 'object' || !src[key]) {
          dst[key] = src[key];
        }
        else {
          if (!target[key]) {
            dst[key] = src[key];
          } else {
            dst[key] = Utils.merge(target[key], src[key]);
          }
        }
      });
    }

    return dst;
  }
632125
function copyExistingProperties(src, dst) {
  Object.keys(dst).forEach(function(key) {
    if (dst.hasOwnProperty(key) && src.hasOwnProperty(key)) {
      dst[key] = src[key];
    }
  });
}
249193
function (src, dst, callback) {
        var srcstream = fs.createReadStream(src);
        var dststream = fs.createWriteStream(dst);

        srcstream.on('error', callback);
        dststream.on('error', callback);
        dststream.on('close', function() {
            return callback && callback();
        });
        srcstream.pipe(dststream);
    }
959527
function relativize (dest, src) {
  // both of these are absolute paths.
  // find the shortest relative distance.
  src = src.split("/")
  var abs = dest
  dest = dest.split("/")
  var i = 0
  while (src[i] === dest[i]) i++
  if (i === 1) return abs // nothing in common, leave absolute
  src.splice(0, i + 1)
  var dots = [0, i, "."]
  for (var i = 0, l = src.length; i < l; i ++) dots.push("..")
  dest.splice.apply(dest, dots)
  dest = dest.join("/")
  return abs.length < dest.length ? abs : dest
}
1180425
private static void copy(ByteBuffer dst, ByteBuffer src) {
    if (dst.hasRemaining() && src.hasRemaining()) {
      // Avoid an allocation if possible.
      if (dst.remaining() >= src.remaining()) {
        dst.put(src);
      } else {
        int count = Math.min(dst.remaining(), src.remaining());
        ByteBuffer slice = src.slice();
        slice.limit(count);
        dst.put(slice);
        src.position(src.position() + count);
      }
    }
  }
504720
def copy(self, src, dst, other_system=None):
        
        copy_source = self.get_client_kwargs(src)
        copy_destination = self.get_client_kwargs(dst)
        with _handle_oss_error():
            bucket = self._get_bucket(copy_destination)
            bucket.copy_object(
                source_bucket_name=copy_source['bucket_name'],
                source_key=copy_source['key'],
                target_key=copy_destination['key'])
641733
def cp(self, src, dst):
        """"""

        _check_dst_absolute(dst)
        resp = self._sendRequest("COPY", src, {'Destination': dst})
        if resp.status_code != 201:
            raise YaDiskException(resp.status_code, resp.content)
1107768
function processFormat( value, src, dst ) {
  if( !dst.format ) return value;
  try {
    if( !Array.isArray( dst.format ) )
      throw "Must be an array with two elements!";
    var intlFunc = dst.format[0];
    if( typeof intlFunc !== 'function' )
      throw "First element of the array must be a function!";
    var intlId = dst.format[1];
    if( typeof intlId !== 'string' )
      throw "Second element of the array must be a string!";
    return intlFunc( intlId, value );
  }
  catch( ex ) {
    console.error( ex );
    fail(
      "Error in format of link "
        + PropertyManager(src.obj) + "." + src.name
        + " -> "
        + PropertyManager(dst.obj) + "." + dst.name + "!\n"
        + ex
    );
  }
}
103610
function copy (src, dst) {
  return new Promise((resolve, reject) => {
    fs.createReadStream(src)
      .on('error', reject)
      .pipe(fs.createWriteStream(dst)
              .on('error', reject)
              .on('close', resolve)
      )
  })
}
359406
def rename(self, src, dst):
        
        with self.pipe as pipe:
            return pipe.rename(self.redis_key(src), self.redis_key(dst))
1025988
def dst_to_src(self, dst_file):
        
        m = re.match(self.dst_path + "/(.*)$", dst_file)
        if (m is None):
            return(None)
        rel_path = m.group(1)
        return(self.src_uri + '/' + rel_path)
796345
def src_to_dst(self, src_uri):
        """"""
        for map in self.mappings:
            dst_path = map.src_to_dst(src_uri)
            if (dst_path is not None):
                return(dst_path)
        # Must have failed if loop exited
        raise MapperError(
            "Unable to translate source URI (%s) into "
            "a destination path." % (src_uri))
146812
def atomic_copy(src, dst):
  """"""
  with temporary_file(root_dir=os.path.dirname(dst)) as tmp_dst:
    shutil.copyfile(src, tmp_dst.name)
    os.chmod(tmp_dst.name, os.stat(src).st_mode)
    os.rename(tmp_dst.name, dst)
570819
def copyfile(src, dst):
    """"""
    if _samefile(src, dst):
        raise Error("`%s` and `%s` are the same file" % (src, dst))

    for fn in [src, dst]:
        try:
            st = os.stat(fn)
        except OSError:
            # File most likely does not exist
            pass
        else:
            # XXX What about other special files? (sockets, devices...)
            if stat.S_ISFIFO(st.st_mode):
                raise SpecialFileError("`%s` is a named pipe" % fn)

    with open(src, 'rb') as fsrc:
        with open(dst, 'wb') as fdst:
            copyfileobj(fsrc, fdst)
802892
def copy_dir(src, dst):
   
   try:
      debug.log("copy dir from "+ src, "to "+ dst)
      shutil.copytree(src, dst)
   except Exception as e:
      debug.log("Error: happened while copying!\n%s\n"%e)