code: def _legacy_weights(layer):
      """Legacy weight order converter.
  
      For legacy reason, the layer.weights was in the order of
      [self.trainable_weights + self.non_trainable_weights], and this order was
      used for preserving the weights in h5 format. The new order of layer.weights
      are the same as layer.get_weights() which is more intuitive for user. To
      keep supporting the existing saved h5 file, this method should be used to
      save/load weights.
  
      Args:
          layer: a `Model` or `Layer` instance.
  
      Returns:
          A list of variables with the legacy weight order.
      """
      return layer.trainable_weights + layer.non_trainable_weights
  
imports: import json
  import os
  import warnings
  import numpy
  from absl import logging
  from keras import backend
  from keras import optimizers
  from keras.backend.common import global_state
  from keras.legacy.saving import json_utils
  from keras.legacy.saving import saving_options
  from keras.legacy.saving import saving_utils
  from keras.saving import object_registration
  from keras.utils import io_utils
label_desc: Use image node_id 12 for calling a global function with example usage: _legacy_weights(layer) and returns: unknown