def _copy(self, src, dst, recursive, use_src_basename):
    src_st = self.stats(src)
    if src_st.isDir and not recursive:
      return # omitting directory

    dst = s3.abspath(src, dst)
    dst_st = self._stats(dst)
    if src_st.isDir and dst_st and not dst_st.isDir:
      raise IOError(errno.EEXIST, (dst, src) % "Cannot overwrite non-directory '%s' with directory '%s'")

    src_bucket, src_key = s3.parse_uri(src)[:2]
    dst_bucket, dst_key = s3.parse_uri(dst)[:2]

    keep_src_basename = use_src_basename and dst_st and dst_st.isDir
    src_bucket = self._get_bucket(src_bucket)
    dst_bucket = self._get_bucket(dst_bucket)

    if keep_src_basename:
      cut = len(posixpath.dirname(src_key))  # cut of an parent directory name
      if cut:
        cut += 1
    else:
      cut = len(src_key)
      if not src_key.endswith('/'):
        cut += 1

    for key in src_bucket.list(prefix=src_key):
      if not key.name.startswith(src_key):
        raise RuntimeError("Invalid key to transform: %s" % key.name)
      dst_name = posixpath.normpath(s3.join(dst_key, key.name[cut:]))
      key.copy(dst_bucket, dst_name)
dataset/ETHPy150Open cloudera/hue/desktop/libs/aws/src/aws/s3/s3fs.py/S3FileSystem._copy/swapped operands of `%`