code: def test_validate_experiment_config():
      """basic examples of validate experiment config."""
      invalid = {1: "face", "2": "3"}
      with pytest.raises(ArgumentTypeError):
          c.validate_experiment_config(invalid)
  
      # a dict value is invalid, even if it's hidden in a list.
      with pytest.raises(ArgumentTypeError):
          c.validate_experiment_config({"key": [{1: 2}, "face"]})
  
      valid = {"a": [1.0, 2, 3], "b": True, "c": 1, "d": "e", "f": 1.2}
      assert valid == c.validate_experiment_config(valid)
  
      # Lists are okay too...
      items = [valid, valid]
      assert items == c.validate_experiment_config(items)
  
      # As are lists of lists.
      lol = [valid, [valid]]
      assert lol == c.validate_experiment_config(lol)
  
      # Invalid types are caught even nested inside lists.
      lol_invalid = [valid, valid, [invalid]]
  
      with pytest.raises(ArgumentTypeError):
          c.validate_experiment_config(lol_invalid)
  
      # Compound keys which violate syntax rules are caught
      invalid_compound = [
          {"[": 0},
          {"eh[": 0},
          {"[test,,fail]": 0},
          {"[,test,fail]": 0},
          {"[I,will,fail,]": 0},
          {"[I,,will,fail]": 0},
          {"]I,will,fail]": 0},
      ]
  
      valid_compound = [
          {"[batch_size,learning_rate]": [0, 1]},
          {
              "[batch_size,learning_rate,dataset_size]": [
                  0.01,
                  0.02,
                  100,
              ]
          },
          {
              "[batch_size,learning_rate,dataset_size]": [
                  [0.01, 0.02, 100],
                  [0.03, 0.05, 200],
              ]
          },
          {"[batch_size,learning_rate]": [[0.0, 1.0], [2.0, 3.0]]},
          {
              "[batch_size,learning_rate]": [
                  [0.0, 1.0],
                  [2.0, 3.0],
                  [4.0, 5.0],
              ]
          },
          {
              "[batch_size, learning_rate, dataset_size]": [
                  0.01,
                  0.02,
                  100,
              ]
          },
          {
              "[batch_size , learning_rate,dataset_size]": [
                  [0.01, 0.02, 100],
                  [0.03, 0.05, 200],
              ]
          },
          {"[batch_size, learning_rate]": [[0.0, 1.0], [2.0, 3.0]]},
          {
              "[batch_size ,learning_rate]": [
                  [0.0, 1.0],
                  [2.0, 3.0],
                  [4.0, 5.0],
              ]
          },
      ]
  
      for i in invalid_compound:
          with pytest.raises(Exception):
              c.validate_experiment_config(i)
  
      for i in valid_compound:
          assert i == c.validate_experiment_config(i)
  
file_path: caliban/tests/caliban/config/test_experiment.py
imports: import json
  from argparse import ArgumentTypeError
  import caliban.config.experiment
  import caliban.util
  import caliban.util.schema
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_validate_experiment_config() without return types