def METHOD_NAME(self, restore, db, domain):
    if isinstance(restore, str):
        restore = io.BytesIO(restore.encode("utf-8"))
    elif isinstance(restore, bytes):
        restore = io.BytesIO(restore)
    meta = db.put(
        restore,
        domain=domain,
        parent_id=self.demo_user_id or "DemoUserRestore",
        type_code=CODES.demo_user_restore,
    )
    self.restore_blob_id = meta.key
    self.content_length = meta.content_length