def _adjust_chunk_size(self, options):
        # type: (Descriptor, blobxfer.models.options.Upload) -> None
        """Adjust chunk size for entity mode
        :param Descriptor self: this
        :param blobxfer.models.options.Upload options: upload options
        """
        chunk_size = options.chunk_size_bytes
        # auto-select chunk size
        if chunk_size == 0:
            if self._ase.mode != blobxfer.models.azure.StorageModes.Block:
                chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
            else:
                if self._ase.size == 0:
                    chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                else:
                    chunk_size = _DEFAULT_AUTO_CHUNKSIZE_BYTES
                    while chunk_size < _MAX_BLOCK_BLOB_CHUNKSIZE_BYTES:
                        chunks = int(math.ceil(self._ase.size / chunk_size))
                        if chunks <= _MAX_NUM_CHUNKS:
                            break
                        chunk_size = chunk_size << 1
            if self._verbose:
                logger.debug(
                    'auto-selected chunk size of {} for {}'.format(
                        chunk_size, self.local_path.absolute_path))
        if self.local_path.use_stdin:
            self._chunk_size = max(
                (chunk_size, _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES)
            )
        else:
            self._chunk_size = min((chunk_size, self._ase.size))
        # ensure chunk sizes are compatible with mode
        if self._ase.mode == blobxfer.models.azure.StorageModes.Append:
            if self._chunk_size > _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES:
                self._chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                if self._verbose:
                    logger.debug(
                        ('adjusting chunk size to {} for append blob '
                         'from {}').format(
                             self._chunk_size, self.local_path.absolute_path))
        elif self._ase.mode == blobxfer.models.azure.StorageModes.Block:
            if (not self.local_path.use_stdin and
                    self._ase.size <= options.one_shot_bytes):
                self._chunk_size = min(
                    (self._ase.size, options.one_shot_bytes)
                )
            else:
                if self._chunk_size > _MAX_BLOCK_BLOB_CHUNKSIZE_BYTES:
                    self._chunk_size = _MAX_BLOCK_BLOB_CHUNKSIZE_BYTES
                    if self._verbose:
                        logger.debug(
                            ('adjusting chunk size to {} for block blob '
                             'from {}').format(
                                self._chunk_size,
                                 self.local_path.absolute_path))
        elif self._ase.mode == blobxfer.models.azure.StorageModes.File:
            if self._chunk_size > _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES:
                self._chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                if self._verbose:
                    logger.debug(
                        'adjusting chunk size to {} for file from {}'.format(
                            self._chunk_size, self.local_path.absolute_path))
        elif self._ase.mode == blobxfer.models.azure.StorageModes.Page:
            if self._ase.size > _MAX_PAGE_BLOB_SIZE:
                raise RuntimeError(
                    '{} size {} exceeds maximum page blob size of {}'.format(
                        self.local_path.absolute_path, self._ase.size,
                        _MAX_PAGE_BLOB_SIZE))
            if self._chunk_size > _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES:
                self._chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                if self._verbose:
                    logger.debug(
                        ('adjusting chunk size to {} for page blob '
                         'from {}').format(
                             self._chunk_size, self.local_path.absolute_path))
Adjust chunk size for entity mode
        :param Descriptor self: this
        :param blobxfer.models.options.Upload options: upload options