code: def test_register_from_metrics():
      # As well as direction inference.
      tracker = metrics_tracking.MetricsTracker(
          metrics=[
              metrics.CategoricalAccuracy(),
              metrics.MeanSquaredError(),
          ]
      )
      assert set(tracker.metrics.keys()) == {
          "categorical_accuracy",
          "mean_squared_error",
      }
      assert tracker.metrics["categorical_accuracy"].direction == "max"
      assert tracker.metrics["mean_squared_error"].direction == "min"
  
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 1 for calling a global function with example usage: test_register_from_metrics() without return types