code: def test_update():
      tracker = metrics_tracking.MetricsTracker()
      tracker.update("new_metric", 0.5)  # automatic registration
      assert set(tracker.metrics.keys()) == {"new_metric"}
      assert (
          tracker.metrics["new_metric"].direction == "min"
      )  # default direction
      assert tracker.get_history("new_metric") == [
          metrics_tracking.MetricObservation(0.5, step=0)
      ]
  
imports: import random
  import numpy
  import pytest
  from keras_tuner.backend.keras import losses
  from keras_tuner.backend.keras import metrics
  from keras_tuner.engine import metrics_tracking
label_desc: Use image node_id 4 for calling a global function with example usage: test_update() without return types