code: def load_spark_model(file_name):
      model = load_model(file_name)
      f = h5py.File(file_name, mode="r")
  
      elephas_conf = json.loads(f.attrs.get("distributed_config"))
      class_name = elephas_conf.get("class_name")
      config = elephas_conf.get("config")
      if class_name == "SparkModel":
          return SparkModel(model=model, **config)
      elif class_name == "SparkMLlibModel":
          return SparkMLlibModel(model=model, **config)
  
imports: import json
  from functools import partial
  from itertools import tee
  from typing import Union
  import h5py
  import numpy
  import pyspark
  from pyspark import RDD
  from tensorflow.keras.models import load_model
  from tensorflow.keras.models import model_from_json
  from tensorflow.keras.optimizers import get
  from tensorflow.keras.optimizers import serialize, deserialize
  from .mllib import to_matrix, from_matrix, to_vector, from_vector
  from .parameter.factory import ClientServerFactory
  from .utils import lp_to_simple_rdd, to_simple_rdd
  from .utils import model_to_dict
  from .utils import subtract_params, divide_by
  from .worker import AsynchronousSparkWorker, SparkWorker
label_desc: Use image node_id 1 for calling a global function with example usage: load_spark_model(file_name) and returns: SparkModel, SparkMLlibModel