code: def upload_dataset(
      self, dataset: CreateDataset
  ) -> Union[SyftSuccess, SyftError]:
      # relative
      from ..types.twin_object import TwinObject
  
      user = self.users.get_current_user()
      dataset = add_default_uploader(user, dataset)
      for i in range(len(dataset.asset_list)):
          asset = dataset.asset_list[i]
          dataset.asset_list[i] = add_default_uploader(user, asset)
  
      dataset._check_asset_must_contain_mock()
      dataset_size = 0
  
      # TODO: Refactor so that object can also be passed to generate warnings
      metadata = self.api.connection.get_node_metadata(
          self.api.signing_key
      )
  
      if (
          metadata.show_warnings
          and metadata.node_side_type == NodeSideType.HIGH_SIDE.value
      ):
          message = (
              "You're approving a request on "
              f"{metadata.node_side_type} side {metadata.node_type} "
              "which may host datasets with private information."
          )
          prompt_warning_message(message=message, confirm=True)
  
      for asset in tqdm(dataset.asset_list):
          print(f"Uploading: {asset.name}")
          try:
              twin = TwinObject(
                  private_obj=asset.data,
                  mock_obj=asset.mock,
                  syft_node_location=self.id,
                  syft_client_verify_key=self.verify_key,
              )
              twin._save_to_blob_storage()
          except Exception as e:
              return SyftError(message=f"Failed to create twin. {e}")
          response = self.api.services.action.set(twin)
          if isinstance(response, SyftError):
              print(f"Failed to upload asset\n: {asset}")
              return response
          asset.action_id = twin.id
          asset.node_uid = self.id
          dataset_size += get_mb_size(asset.data)
      dataset.mb_size = dataset_size
      valid = dataset.check()
      if valid.ok():
          return self.api.services.dataset.add(dataset=dataset)
      else:
          if len(valid.err()) > 0:
              return tuple(valid.err())
          return valid.err()
  
imports: from __future__ import annotations
  from typing import Optional
  from typing import TYPE_CHECKING
  from typing import Union
  from tqdm import tqdm
  from ..abstract_node import NodeSideType
  from ..img.base64 import base64read
  from ..serde.serializable import serializable
  from ..service.code_history.code_history import CodeHistoriesDict
  from ..service.code_history.code_history import UsersCodeHistoriesDict
  from ..service.dataset.dataset import Contributor
  from ..service.dataset.dataset import CreateAsset
  from ..service.dataset.dataset import CreateDataset
  from ..service.response import SyftError
  from ..service.response import SyftSuccess
  from ..service.user.roles import Roles
  from ..service.user.user_roles import ServiceRole
  from ..types.uid import UID
  from ..util.fonts import fonts_css
  from ..util.util import get_mb_size
  from ..util.util import prompt_warning_message
  from .api import APIModule
  from .client import SyftClient
  from .client import login
  from .client import login_as_guest
label_desc: Use image node_id 2 for calling the DomainClient obj's underlying member method code with example usage: obj.upload_dataset(dataset) and returns: self, valid, response, tuple, SyftError