code: def load_weights_only(model, filepath, skip_mismatch=False):
      """Load the weights of a model from a filepath (.keras or .weights.h5).
  
      Note: only supports h5 for now.
      """
      temp_dir = None
      archive = None
      filepath = str(filepath)
      if filepath.endswith(".weights.h5"):
          # TODO: download file if h5 filepath is remote
          weights_store = H5IOStore(filepath, mode="r")
      elif filepath.endswith(".keras"):
          archive = zipfile.ZipFile(filepath, "r")
          weights_store = H5IOStore(
              _VARS_FNAME + ".h5", archive=archive, mode="r"
          )
  
      failed_trackables = set()
      error_msgs = {}
      _load_state(
          model,
          weights_store=weights_store,
          assets_store=None,
          inner_path="",
          skip_mismatch=skip_mismatch,
          visited_trackables=set(),
          failed_trackables=failed_trackables,
          error_msgs=error_msgs,
      )
      weights_store.close()
      if temp_dir and file_utils.exists(temp_dir):
          file_utils.rmtree(temp_dir)
      if archive:
          archive.close()
  
      if failed_trackables:
          _raise_loading_failure(error_msgs, warn_only=skip_mismatch)
  
imports: import datetime
  import io
  import json
  import tempfile
  import warnings
  import zipfile
  import numpy
  from keras.backend.common import global_state
  from keras.layers.layer import Layer
  from keras.losses.loss import Loss
  from keras.metrics.metric import Metric
  from keras.optimizers.optimizer import Optimizer
  from keras.saving.serialization_lib import ObjectSharingScope
  from keras.saving.serialization_lib import deserialize_keras_object
  from keras.saving.serialization_lib import serialize_keras_object
  from keras.trainers.compile_utils import CompileMetrics
  from keras.utils import file_utils
  from keras.utils import naming
  from keras.version import __version__
label_desc: Use image node_id 4 for calling a global function with example usage: load_weights_only(model, filepath, skip_mismatch) without return types