'Constructor for wrapping blobstore entity.
The constructor should not be used outside this package and tests.
Args:
entity: Datastore entity that represents the blob reference.'

def __init__(self, entity_or_blob_key, _values=None):

    if isinstance(entity_or_blob_key, datastore.Entity):
        self.__entity = entity_or_blob_key
        self.__key = BlobKey(entity_or_blob_key.key().name())
    elif isinstance(entity_or_blob_key, BlobKey):
        self.__entity = _values
        self.__key = entity_or_blob_key
    else:
        TypeError('Must    provide    Entity    or    BlobKey')
