code: def test_selection_config_from_dict() -> None:
      dataset_id = utils.generate_id()
      cfg = {
          "n_samples": 10,
          "proportion_samples": 0.1,
          "strategies": [
              {
                  "input": {
                      "type": "EMBEDDINGS",
                      "dataset_id": dataset_id,
                      "tag_name": "some-tag-name",
                  },
                  "strategy": {"type": "SIMILARITY"},
              },
              {
                  "input": {
                      "type": "METADATA",
                      "key": "lightly.sharpness",
                  },
                  "strategy": {
                      "type": "THRESHOLD",
                      "threshold": 20,
                      "operation": "BIGGER",
                  },
              },
          ],
      }
      selection_cfg = (
          api_workflow_compute_worker.selection_config_from_dict(cfg)
      )
      assert selection_cfg.n_samples == 10
      assert selection_cfg.proportion_samples == 0.1
      assert selection_cfg.strategies is not None
      assert len(selection_cfg.strategies) == 2
      assert selection_cfg.strategies[0].input.type == "EMBEDDINGS"
      assert selection_cfg.strategies[0].input.dataset_id == dataset_id
      assert (
          selection_cfg.strategies[0].input.tag_name == "some-tag-name"
      )
      assert selection_cfg.strategies[0].strategy.type == "SIMILARITY"
      assert selection_cfg.strategies[1].input.type == "METADATA"
      assert (
          selection_cfg.strategies[1].input.key == "lightly.sharpness"
      )
      assert selection_cfg.strategies[1].strategy.type == "THRESHOLD"
      assert selection_cfg.strategies[1].strategy.threshold == 20
      assert selection_cfg.strategies[1].strategy.operation == "BIGGER"
      # verify that original dict was not mutated
      assert isinstance(cfg["strategies"][0]["input"], dict)
  
imports: import json
  import random
  from typing import Any, List
  from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from pydantic import ValidationError
  from pytest_mock import MockerFixture
  from lightly.api import ApiWorkflowClient, api_workflow_compute_worker
  from lightly.api.api_workflow_compute_worker import STATE_SCHEDULED_ID_NOT_FOUND, ComputeWorkerRunInfo, InvalidConfigurationError, _config_to_camel_case, _snake_to_camel_case, _validate_config
  from lightly.openapi_generated.swagger_client.api import DockerApi
  from lightly.openapi_generated.swagger_client.api_client import ApiClient
  from lightly.openapi_generated.swagger_client.models import DockerRunData, DockerRunScheduledData, DockerRunScheduledPriority, DockerRunScheduledState, DockerRunState, DockerWorkerConfigV3, DockerWorkerConfigV3Docker, DockerWorkerConfigV3DockerCorruptnessCheck, DockerWorkerConfigV3Lightly, DockerWorkerConfigV3LightlyCollate, DockerWorkerConfigV3LightlyLoader, DockerWorkerState, DockerWorkerType, SelectionConfigV3, SelectionConfigV3Entry, SelectionConfigV3EntryInput, SelectionConfigV3EntryStrategy, SelectionInputPredictionsName, SelectionInputType, SelectionStrategyThresholdOperation, SelectionStrategyTypeV3, TagData
  from lightly.openapi_generated.swagger_client.rest import ApiException
  from tests.api_workflow import utils
  from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup
label_desc: Use image node_id 1 for calling a global function with example usage: test_selection_config_from_dict() without return types