def create_blob_from_stream(<EOL>self, container_name, blob_name, stream, count=None,<EOL>content_settings=None, metadata=None, validate_content=False,<EOL>progress_callback=None, max_connections=<NUM_LIT:2>, lease_id=None,<EOL>if_modified_since=None, if_unmodified_since=None, if_match=None,<EOL>if_none_match=None, timeout=None, use_byte_buffer=False):
_validate_not_none('<STR_LIT>', container_name)<EOL>_validate_not_none('<STR_LIT>', blob_name)<EOL>_validate_not_none('<STR_LIT>', stream)<EOL>_validate_encryption_required(self.require_encryption, self.key_encryption_key)<EOL>adjusted_count = count<EOL>if (self.key_encryption_key is not None) and (adjusted_count is not None):<EOL><INDENT>adjusted_count += (<NUM_LIT:16> - (count % <NUM_LIT:16>))<EOL><DEDENT>if adjusted_count and adjusted_count < self.MAX_SINGLE_PUT_SIZE:<EOL><INDENT>if progress_callback:<EOL><INDENT>progress_callback(<NUM_LIT:0>, count)<EOL><DEDENT>data = stream.read(count)<EOL>self._put_blob(<EOL>container_name=container_name,<EOL>blob_name=blob_name,<EOL>blob=data,<EOL>content_settings=content_settings,<EOL>metadata=metadata,<EOL>validate_content=validate_content,<EOL>lease_id=lease_id,<EOL>if_modified_since=if_modified_since,<EOL>if_unmodified_since=if_unmodified_since,<EOL>if_match=if_match,<EOL>if_none_match=if_none_match,<EOL>timeout=timeout)<EOL>if progress_callback:<EOL><INDENT>progress_callback(count, count)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>cek, iv, encryption_data = None, None, None<EOL>use_original_upload_path = use_byte_buffer or self.require_encryption orself.MAX_BLOCK_SIZE < self.MIN_LARGE_BLOCK_UPLOAD_THRESHOLD orhasattr(stream, '<STR_LIT>') and not stream.seekable() ornot hasattr(stream, '<STR_LIT>') or not hasattr(stream, '<STR_LIT>')<EOL>if use_original_upload_path:<EOL><INDENT>if self.key_encryption_key:<EOL><INDENT>cek, iv, encryption_data = _generate_blob_encryption_data(self.key_encryption_key)<EOL><DEDENT>block_ids = _upload_blob_chunks(<EOL>blob_service=self,<EOL>container_name=container_name,<EOL>blob_name=blob_name,<EOL>blob_size=count,<EOL>block_size=self.MAX_BLOCK_SIZE,<EOL>stream=stream,<EOL>max_connections=max_connections,<EOL>progress_callback=progress_callback,<EOL>validate_content=validate_content,<EOL>lease_id=lease_id,<EOL>uploader_class=_BlockBlobChunkUploader,<EOL>timeout=timeout,<EOL>content_encryption_key=cek,<EOL>initialization_vector=iv<EOL>)<EOL><DEDENT>else:<EOL><INDENT>block_ids = _upload_blob_substream_blocks(<EOL>blob_service=self,<EOL>container_name=container_name,<EOL>blob_name=blob_name,<EOL>blob_size=count,<EOL>block_size=self.MAX_BLOCK_SIZE,<EOL>stream=stream,<EOL>max_connections=max_connections,<EOL>progress_callback=progress_callback,<EOL>validate_content=validate_content,<EOL>lease_id=lease_id,<EOL>uploader_class=_BlockBlobChunkUploader,<EOL>timeout=timeout,<EOL>)<EOL><DEDENT>self._put_block_list(<EOL>container_name=container_name,<EOL>blob_name=blob_name,<EOL>block_list=block_ids,<EOL>content_settings=content_settings,<EOL>metadata=metadata,<EOL>validate_content=validate_content,<EOL>lease_id=lease_id,<EOL>if_modified_since=if_modified_since,<EOL>if_unmodified_since=if_unmodified_since,<EOL>if_match=if_match,<EOL>if_none_match=if_none_match,<EOL>timeout=timeout,<EOL>encryption_data=encryption_data<EOL>)<EOL><DEDENT>
Creates a new blob from a file/stream, or updates the content of
an existing blob, with automatic chunking and progress
notifications.

:param str container_name:
    Name of existing container.
:param str blob_name:
    Name of blob to create or update.
:param io.IOBase stream:
    Opened file/stream to upload as the blob content.
:param int count:
    Number of bytes to read from the stream. This is optional, but
    should be supplied for optimal performance.
:param ~azure.storage.blob.models.ContentSettings content_settings:
    ContentSettings object used to set blob properties.
:param metadata:
    Name-value pairs associated with the blob as metadata.
:type metadata: a dict mapping str to str
:param bool validate_content:
    If true, calculates an MD5 hash for each chunk of the blob. The storage
    service checks the hash of the content that has arrived with the hash
    that was sent. This is primarily valuable for detecting bitflips on
    the wire if using http instead of https as https (the default) will
    already validate. Note that this MD5 hash is not stored with the
    blob.
:param progress_callback:
    Callback for progress with signature function(current, total) where
    current is the number of bytes transfered so far, and total is the
    size of the blob, or None if the total size is unknown.
:type progress_callback: callback function in format of func(current, total)
:param int max_connections:
    Maximum number of parallel connections to use when the blob size exceeds
    64MB. Note that parallel upload requires the stream to be seekable.
:param str lease_id:
    Required if the blob has an active lease.
:param datetime if_modified_since:
    A DateTime value. Azure expects the date value passed in to be UTC.
    If timezone is included, any non-UTC datetimes will be converted to UTC.
    If a date is passed in without timezone info, it is assumed to be UTC.
    Specify this header to perform the operation only
    if the resource has been modified since the specified time.
:param datetime if_unmodified_since:
    A DateTime value. Azure expects the date value passed in to be UTC.
    If timezone is included, any non-UTC datetimes will be converted to UTC.
    If a date is passed in without timezone info, it is assumed to be UTC.
    Specify this header to perform the operation only if
    the resource has not been modified since the specified date/time.
:param str if_match:
    An ETag value, or the wildcard character (*). Specify this header to perform
    the operation only if the resource's ETag matches the value specified.
:param str if_none_match:
    An ETag value, or the wildcard character (*). Specify this header
    to perform the operation only if the resource's ETag does not match
    the value specified. Specify the wildcard character (*) to perform
    the operation only if the resource does not exist, and fail the
    operation if it does exist.
:param int timeout:
    The timeout parameter is expressed in seconds. This method may make
    multiple calls to the Azure service and the timeout will apply to
    each call individually.
:param bool use_byte_buffer:
    If True, this will force usage of the original full block buffering upload path.
    By default, this value is False and will employ a memory-efficient,
    streaming upload algorithm under the following conditions:
    The provided stream is seekable, 'require_encryption' is False, and
    MAX_BLOCK_SIZE >= MIN_LARGE_BLOCK_UPLOAD_THRESHOLD.
    One should consider the drawbacks of using this approach. In order to achieve
    memory-efficiency, a IOBase stream or file-like object is segmented into logical blocks
    using a SubStream wrapper. In order to read the correct data, each SubStream must acquire
    a lock so that it can safely seek to the right position on the shared, underlying stream.
    If max_connections > 1, the concurrency will result in a considerable amount of seeking on
    the underlying stream. For the most common inputs such as a file-like stream object, seeking
    is an inexpensive operation and this is not much of a concern. However, for other variants of streams
    this may not be the case. The trade-off for memory-efficiency must be weighed against the cost of seeking
    with your input stream.
    The SubStream class will attempt to buffer up to 4 MB internally to reduce the amount of
    seek and read calls to the underlying stream. This is particularly beneficial when uploading larger blocks.