def _put_block(self, container_name, blob_name, block, block_id,<EOL>validate_content=False, lease_id=None, timeout=None):
_validate_not_none('<STR_LIT>', container_name)<EOL>_validate_not_none('<STR_LIT>', blob_name)<EOL>_validate_not_none('<STR_LIT>', block)<EOL>_validate_not_none('<STR_LIT>', block_id)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT>'<EOL>request.host_locations = self._get_host_locations()<EOL>request.path = _get_path(container_name, blob_name)<EOL>request.query = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': _encode_base64(_to_str(block_id)),<EOL>'<STR_LIT>': _int_to_str(timeout),<EOL>}<EOL>request.headers = {<EOL>'<STR_LIT>': _to_str(lease_id)<EOL>}<EOL>request.body = _get_data_bytes_or_stream_only('<STR_LIT>', block)<EOL>if hasattr(request.body, '<STR_LIT>'):<EOL><INDENT>if _len_plus(request.body) is None:<EOL><INDENT>try:<EOL><INDENT>data = b'<STR_LIT>'<EOL>for chunk in iter(lambda: request.body.read(<NUM_LIT>), b"<STR_LIT>"):<EOL><INDENT>data += chunk<EOL><DEDENT>request.body = data<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise ValueError(_ERROR_VALUE_SHOULD_BE_STREAM.format('<STR_LIT>'))<EOL><DEDENT><DEDENT><DEDENT>if validate_content:<EOL><INDENT>computed_md5 = _get_content_md5(request.body)<EOL>request.headers['<STR_LIT>'] = _to_str(computed_md5)<EOL><DEDENT>self._perform_request(request)<EOL>
See put_block for more details. This helper method
allows for encryption or other such special behavior because
it is safely handled by the library. These behaviors are
prohibited in the public version of this function.