code: def test_dict_class_weights_set():
      input_features = [category_feature()]
      output_features = [set_feature()]
      config = {
          "input_features": input_features,
          "output_features": output_features,
      }
  
      # Set class weights as dictionary on config
      class_weights_dict = {
          "token_1": 0.1,
          "token_2": 0.2,
          "token_3": 0.3,
          "<UNK>": 0,
      }
      config["output_features"][0]["loss"] = {
          "type": "sigmoid_cross_entropy",
          "class_weights": class_weights_dict,
      }
  
      # Mock feature metadata
      feature_metadata = {
          "idx2str": ["token_1", "token_2", "token_3", "<UNK>"],
          "str2idx": {
              "token_1": 0,
              "token_2": 1,
              "token_3": 2,
              "<UNK>": 3,
          },
          "str2freq": {
              "token_1": 300,
              "token_2": 200,
              "token_3": 100,
              "<UNK>": 0,
          },
          "vocab_size": 4,
          "max_set_size": 3,
          "preprocessing": {
              "tokenizer": "space",
              "missing_value_strategy": "drop_row",
              "fill_value": "<UNK>",
              "computed_fill_value": "<UNK>",
              "lowercase": False,
              "most_common": 10000,
          },
      }
  
      model_config = ModelConfig.from_dict(config)
  
      SetOutputFeature.update_config_with_metadata(
          feature_config=model_config.output_features[0],
          feature_metadata=feature_metadata,
      )
  
      assert model_config.output_features[0].loss.class_weights == [
          0.1,
          0.2,
          0.3,
          0,
      ]
  
imports: import contextlib
  from typing import Optional, Type, Union
  import pytest
  import torch
  from marshmallow import ValidationError
  from ludwig.features.category_feature import CategoryOutputFeature
  from ludwig.features.set_feature import SetOutputFeature
  from ludwig.features.text_feature import TextOutputFeature
  from ludwig.modules import loss_modules
  from ludwig.schema.features.loss.loss import BWCEWLossConfig, CORNLossConfig, HuberLossConfig, MAELossConfig, MAPELossConfig, MSELossConfig, RMSELossConfig, RMSPELossConfig, SigmoidCrossEntropyLossConfig, SoftmaxCrossEntropyLossConfig
  from ludwig.schema.model_config import ModelConfig
  from tests.integration_tests.utils import category_feature, set_feature, text_feature
label_desc: Use image node_id 15 for calling a global function with example usage: test_dict_class_weights_set() without return types