#NEWLINE# def StoreBlob( self , blob_key , blob_stream ) : #NEWLINE# #INDENT# 'Store blob stream to the datastore.\n\n    Args:\n      blob_key: Blob key of blob to store.\n      blob_stream: Stream or stream-like object that will generate blob content.\n    ' #NEWLINE# block_count = 0 #NEWLINE# blob_key_object = self . _BlobKey ( blob_key ) #NEWLINE# while True : #NEWLINE# #INDENT# block = blob_stream . read ( blobstore . MAX_BLOB_FETCH_SIZE ) #NEWLINE# if ( not block ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# entity = datastore . Entity ( _BLOB_CHUNK_KIND_ , name = ( ( str ( blob_key_object ) + '__' ) + str ( block_count ) ) , namespace = '' ) #NEWLINE# entity . update ( { #NEWLINE# #INDENT# 'block' : datastore_types . Blob ( block ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# datastore . Put ( entity ) #NEWLINE# block_count += 1