def push(self, src: typing.Union[pathlib.Path, str, bytes, bytearray, typing.BinaryIO],
             dst: typing.Union[pathlib.Path, str],
             mode: int = 0o755,
             check: bool = False) -> int:
        """
        Push file from local:src to device:dst

        Args:
            src: source file path
            dst: destination file path or directory path
            mode: file mode
            check: check if push size is correct
        
        Returns:
            total file size pushed
        """
        if isinstance(dst, pathlib.Path):
            dst = dst.as_posix()
        finfo = self.stat(dst)
        if finfo.mode & stat.S_IFDIR != 0:
            if not isinstance(src, (pathlib.Path, str)):
                raise AdbSyncError("src should be a file path when dst is a directory")
            dst = append_path(dst, pathlib.Path(src).name)
            logger.debug("dst is a directory, update dst to %s", dst)
        return self._push_file(src, dst, mode, check)

        Push file from local:src to device:dst

        Args:
            src: source file path
            dst: destination file path or directory path
            mode: file mode
            check: check if push size is correct
        
        Returns:
            total file size pushed
        
adbutils/sync.py