code: def test_keras_from_config() -> None:
      from tests.experiment.fixtures import tf_keras_one_var_model
  
      data_len = 10
      lr = 0.001
      config = {
          "hyperparameters": {
              "global_batch_size": 1,
              "learning_rate": lr,
              "dataset_range": data_len,
          },
          "searcher": {"metric": "val_loss"},
      }
      context = keras.TFKerasTrialContext.from_config(config)
      trial = tf_keras_one_var_model.OneVarTrial(context)
  
      model = trial.build_model()
      model.fit(trial.build_training_data_loader(), verbose=0)
      eval_loss = model.evaluate(
          trial.build_validation_data_loader(), verbose=0
      )
  
      # Simulate the training that would happen.
      weight = 0.0
      for _epoch in range(1):
          for data in range(data_len):
              grad = trial.calc_gradient(weight, [data])
              weight -= lr * grad
  
      # Simulate validation loss.
      sim_loss = trial.calc_loss(weight, range(data_len))
  
      assert sim_loss == pytest.approx(eval_loss)
  
file_path: determined/harness/tests/experiment/test_local.py
imports: import pathlib
  import typing
  import pytest
  from _pytest import monkeypatch
  import determined
  from determined import experimental, keras, pytorch
  from tests.experiment.fixtures import pytorch_onevar_model
label_desc: Use image node_id 2 for calling a global function with example usage: test_keras_from_config() without return types