code: def check_set_metadata(task, target, metadata):
      """Check set_metadata."""
      task = task(target=target)
      assert task.metadata is None
  
      task.set_metadata(metadata)
      assert task.metadata is not None
  
      # cannot be re-set
      with raises(AttributeError):
          task.set_metadata(metadata)
  
imports: import pytest
  from pytest import raises
  from sktime.benchmarking.tasks import BaseTask, TSCTask, TSRTask
  from sktime.datasets import load_gunpoint, load_shampoo_sales
label_desc: Use image node_id 3 for calling a global function with example usage: check_set_metadata(task, target, metadata) without return types