code: def test_user_attrs_with_exception() -> None:
      with StorageSupplier("sqlite") as storage:
          if dist.get_rank() == 0:
              study = optuna.create_study(storage=storage)
              trial = TorchDistributedTrial(study.ask())
          else:
              trial = TorchDistributedTrial(None)
  
          with pytest.raises(TypeError):
              trial.set_user_attr(
                  "not serializable", torch.Tensor([1, 2])
              )
  
imports: import datetime
  import os
  from typing import Optional
  import pytest
  import optuna
  from optuna._imports import try_import
  from optuna.integration import TorchDistributedTrial
  from optuna.testing.pruners import DeterministicPruner
  from optuna.testing.storages import StorageSupplier
label_desc: Use image node_id 14 for calling a global function with example usage: test_user_attrs_with_exception() without return types