def get_blob_to_stream(<EOL>self, container_name, blob_name, stream, snapshot=None,<EOL>start_range=None, end_range=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):
_validate_not_none('<STR_LIT>', container_name)<EOL>_validate_not_none('<STR_LIT>', blob_name)<EOL>_validate_not_none('<STR_LIT>', stream)<EOL>if max_connections == <NUM_LIT:1>:<EOL><INDENT>blob = self._get_blob(container_name,<EOL>blob_name,<EOL>snapshot,<EOL>start_range=start_range,<EOL>end_range=end_range,<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>download_size = blob.properties.content_length<EOL><DEDENT>else:       <EOL><INDENT>if sys.version_info >= (<NUM_LIT:3>,) and not stream.seekable():<EOL><INDENT>raise ValueError(_ERROR_PARALLEL_NOT_SEEKABLE)<EOL><DEDENT>first_get_size = self.MAX_SINGLE_GET_SIZE if not validate_content else self.MAX_CHUNK_GET_SIZE<EOL>initial_request_start = start_range if start_range else <NUM_LIT:0><EOL>if end_range and end_range - start_range < first_get_size:<EOL><INDENT>initial_request_end = end_range<EOL><DEDENT>else:<EOL><INDENT>initial_request_end = initial_request_start + first_get_size - <NUM_LIT:1><EOL><DEDENT>operation_context = _OperationContext(location_lock=True)<EOL>try:<EOL><INDENT>blob = self._get_blob(container_name,<EOL>blob_name,<EOL>snapshot,<EOL>start_range=initial_request_start,<EOL>end_range=initial_request_end,<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>_context=operation_context)<EOL>blob_size = _parse_length_from_content_range(blob.properties.content_range)<EOL>if end_range:<EOL><INDENT>download_size = min(blob_size, end_range - start_range + <NUM_LIT:1>)<EOL><DEDENT>elif start_range:<EOL><INDENT>download_size = blob_size - start_range<EOL><DEDENT>else:<EOL><INDENT>download_size = blob_size<EOL><DEDENT><DEDENT>except AzureHttpError as ex:<EOL><INDENT>if not start_range and ex.status_code == <NUM_LIT>:<EOL><INDENT>blob = self._get_blob(container_name,<EOL>blob_name,<EOL>snapshot,<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>_context=operation_context)<EOL>download_size = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>raise ex<EOL><DEDENT><DEDENT><DEDENT>if progress_callback:<EOL><INDENT>progress_callback(blob.properties.content_length, download_size)<EOL><DEDENT>if blob.content is not None:<EOL><INDENT>stream.write(blob.content)<EOL>blob.content = None<EOL><DEDENT>if blob.properties.content_length != download_size:       <EOL><INDENT>if_match = if_match if if_match is not None else blob.properties.etag    <EOL>end_blob = blob_size<EOL>if end_range:<EOL><INDENT>end_blob = min(blob_size, end_range + <NUM_LIT:1>)<EOL><DEDENT>_download_blob_chunks(<EOL>self,<EOL>container_name,<EOL>blob_name,<EOL>snapshot,<EOL>download_size,<EOL>self.MAX_CHUNK_GET_SIZE,<EOL>first_get_size,<EOL>initial_request_end + <NUM_LIT:1>, <EOL>end_blob,<EOL>stream,<EOL>max_connections,<EOL>progress_callback,<EOL>validate_content,<EOL>lease_id,<EOL>if_modified_since,<EOL>if_unmodified_since,<EOL>if_match,<EOL>if_none_match,<EOL>timeout,<EOL>operation_context<EOL>)<EOL>blob.properties.content_length = download_size<EOL>blob.properties.content_range = '<STR_LIT>'.format(start_range, end_range, blob_size)<EOL>blob.properties.content_md5 = None<EOL><DEDENT>return blob<EOL>
Downloads a blob to a stream, with automatic chunking and progress
notifications. Returns an instance of :class:`Blob` with
properties and metadata.

:param str container_name:
    Name of existing container.
:param str blob_name:
    Name of existing blob.
:param io.IOBase stream:
    Opened stream to write to.
:param str snapshot:
    The snapshot parameter is an opaque DateTime value that,
    when present, specifies the blob snapshot to retrieve.
:param int start_range:
    Start of byte range to use for downloading a section of the blob.
    If no end_range is given, all bytes after the start_range will be downloaded.
    The start_range and end_range params are inclusive.
    Ex: start_range=0, end_range=511 will download first 512 bytes of blob.
:param int end_range:
    End of byte range to use for downloading a section of the blob.
    If end_range is given, start_range must be provided.
    The start_range and end_range params are inclusive.
    Ex: start_range=0, end_range=511 will download first 512 bytes of blob.
:param bool validate_content:
    If set to true, validates an MD5 hash for each retrieved portion of 
    the blob. 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 the service will only return transactional MD5s 
    for chunks 4MB or less so the first get request will be of size 
    self.MAX_CHUNK_GET_SIZE instead of self.MAX_SINGLE_GET_SIZE. If 
    self.MAX_CHUNK_GET_SIZE was set to greater than 4MB an error will be 
    thrown. As computing the MD5 takes processing time and more requests 
    will need to be done due to the reduced chunk size there may be some 
    increase in latency.
: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 if known.
:type progress_callback: callback function in format of func(current, total)
:param int max_connections:
    If set to 2 or greater, an initial get will be done for the first 
    self.MAX_SINGLE_GET_SIZE bytes of the blob. If this is the entire blob, 
    the method returns at this point. If it is not, it will download the 
    remaining data parallel using the number of threads equal to 
    max_connections. Each chunk will be of size self.MAX_CHUNK_GET_SIZE.
    If set to 1, a single large get request will be done. This is not 
    generally recommended but available if very few threads should be 
    used, network requests are very expensive, or a non-seekable stream 
    prevents parallel download. This may also be useful if many blobs are 
    expected to be empty as an extra request is required for empty blobs 
    if max_connections is greater than 1.
: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.
:return: A Blob with properties and metadata. If max_connections is greater 
    than 1, the content_md5 (if set on the blob) will not be returned. If you 
    require this value, either use get_blob_properties or set max_connections 
    to 1.
:rtype: :class:`~azure.storage.blob.models.Blob`