def METHOD_NAME(
    self,
    src_dir: PathLike,
    dst_dir: PathLike,
    excludes: t.List[str],
    ignore_venv_or_conda: bool = True,
) -> int:
    """
    Copy a directory from src_dir to the dst_dir using the object store cache.
    When the file is already in the object store, it will be linked instead of copied.
    Args:
        src_dir: the source directory
        dst_dir: the destination directory
        excludes: the files to be excluded
        ignore_venv_or_conda: whether to ignore virtual environments or conda environments
    Returns: total file size in bytes
    """
    src_dir = Path(src_dir)
    dst_dir = Path(dst_dir)
    ignore_dirs = self._search_all_py_envs(src_dir) if ignore_venv_or_conda else []
    size = 0  # no record for soft link (inode not working in windows)
    for src in src_dir.rglob("*"):
        if not src.is_file():
            continue
        # check if the file under any of the ignored dirs
        ignore = False
        for ignore_dir in ignore_dirs:
            if self._is_file_under_dir(src, ignore_dir):
                ignore = True
                break
        if ignore or any(
            [fnmatch.fnmatch(str(src), str(src_dir / ex)) for ex in excludes]
        ):
            console.trace(f"ignore to copy file: {src}")
            continue
        file_size = src.stat().st_size
        size += file_size
        console.trace(f"copy file: {src}, size: {pretty_bytes(file_size)}")
        file = self._put(path=src)
        dst = dst_dir / src.relative_to(src_dir)
        dst.parent.mkdir(parents=True, exist_ok=True)
        file.link(dst, soft=self.soft_link)
    return size