code: def test_user_attrs() -> None:
      study = optuna.multi_objective.create_study(
          ["maximize", "minimize", "maximize"]
      )
  
      def objective(
          trial: optuna.multi_objective.trial.MultiObjectiveTrial,
      ) -> List[float]:
          trial.set_user_attr("foo", "bar")
          assert trial.user_attrs == {"foo": "bar"}
  
          trial.set_user_attr("baz", "qux")
          assert trial.user_attrs == {"foo": "bar", "baz": "qux"}
  
          trial.set_user_attr("foo", "quux")
          assert trial.user_attrs == {"foo": "quux", "baz": "qux"}
  
          return [0, 0, 0]
  
      study.optimize(objective, n_trials=1)
  
      assert study.trials[0].user_attrs == {"foo": "quux", "baz": "qux"}
  
file_path: optuna/tests/multi_objective_tests/test_trial.py
imports: from __future__ import annotations
  import datetime
  from typing import List
  from typing import Tuple
  import pytest
  import optuna
  from optuna.multi_objective.trial import FrozenMultiObjectiveTrial
  from optuna.study._study_direction import StudyDirection
  from optuna.trial import TrialState
label_desc: Use image node_id 4 for calling a global function with example usage: test_user_attrs() and returns: list