docstr: Turns `logs` dict into a list as per key order of `metrics_names`.
code: def _flatten_metrics_in_order(self, logs):
      """Turns `logs` dict into a list as per key order of `metrics_names`."""
      metric_names = [m.name for m in self.metrics]
      results = []
      for name in metric_names:
          if name in logs:
              results.append(logs[name])
      for key in sorted(logs.keys()):
          if key not in metric_names:
              results.append(logs[key])
      if len(results) == 1:
          return results[0]
      return results
  
imports: import platform
  import warnings
  import tree
  from keras import backend
  from keras import metrics
  from keras import ops
  from keras import optimizers
  from keras.optimizers.loss_scale_optimizer import LossScaleOptimizer
  from keras.saving import serialization_lib
  from keras.trainers.compile_utils import CompileLoss
  from keras.trainers.compile_utils import CompileMetrics
  from keras.trainers.data_adapters import data_adapter_utils
  from keras.utils import traceback_utils
  from keras.utils import tracking
label_desc: Use image node_id 25 for calling the Trainer obj's underlying member method code with example usage: obj._flatten_metrics_in_order(logs) and returns: results, results