code: def record_measurements(
      step: int,
      reporters: Dict[str, uv.AbstractReporter],
      measure_batch_size: int,
      model,
      training_data,
      test_data,
  ):
      """This function actually records various metrics.
  
      NOTE that all of these measurements could have been recorded on the same base
      reporter! The only reason to break up the measurement like this is for style
      reasons.
  
      """
  
      # This section calculates loss and accuracy on the full training set and reports it to the base reporter with a prefix of "train".
      train_m = total_metrics(model, training_data, measure_batch_size)
      reporters["train"].report_all(step, train_m)
  
      # This section calculates loss and accuracy on the full TEST set and reports
      # it to the base reporter with a prefix of "test".
      test_m = total_metrics(model, test_data, measure_batch_size)
      reporters["test"].report_all(step, test_m)
  
      # This measurement is on the model itself, so we report it to the base with a
      # "model" prefix.
      weight_norm_sqr = sum(
          [tf.math.square(tf.norm(w)) for w in model.weights]
      )
      reporters["model"].report(step, "w2", weight_norm_sqr)
  
imports: from __future__ import division, print_function
  import getpass
  from typing import Dict, Optional
  import fs
  import tensorflow
  import tensorflow_datasets
  import tqdm
  import uv
  import uv.tensorflow.reporter
  import uv.util
  from absl import app
  from uv.fs.reporter import FSReporter
  from uv.mlflow.reporter import MLFlowReporter
  from trainer import cli
label_desc: Use image node_id 13 for calling a global function with example usage: record_measurements(step, reporters, measure_batch_size, model, training_data, test_data) without return types