code: def parse_sparkml_api_model(model, extra_config={}):
      """
      Puts *Spark-ML* object into an abstract representation so that our framework can work seamlessly on models created
      with different machine learning tools.
  
      Args:
          model: A model object in Spark-ML format
  
      Returns:
          A `onnxconverter_common.topology.Topology` object representing the input model
      """
      assert model is not None, "Cannot convert a mode of type None."
  
      raw_model_container = CommonSparkMLModelContainer(model)
  
      # Declare a computational graph. It will become a representation of
      # the input Spark-ML model after parsing.
      topology = Topology(raw_model_container)
  
      # Declare input variables.
      inputs = _declare_input_variables(
          topology, raw_model_container, extra_config
      )
  
      # Parse the input Spark-ML model into its topology with the topology.
      # Get the outputs of the model.
      current_op_outputs, _ = _parse_sparkml_api(
          topology, model, inputs
      )
  
      # Declare output variables.
      _declare_output_variables(
          raw_model_container, extra_config, current_op_outputs
      )
  
      return topology
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import pprint
  from uuid import uuid4
  import numpy
  from onnxconverter_common.optimizer import LinkedNode, _topological_sort
  from sklearn import pipeline
  from sklearn.compose import ColumnTransformer
  from sklearn.ensemble import BaggingClassifier, BaggingRegressor
  from sklearn.model_selection import GridSearchCV, RandomizedSearchCV
  from sklearn.multioutput import MultiOutputRegressor, RegressorChain
  from sklearn.preprocessing import OneHotEncoder
  from .containers import CommonSklearnModelContainer, CommonONNXModelContainer, CommonSparkMLModelContainer
  from ._topology import Topology
  from ._utils import sklearn_installed, sparkml_installed
  from .operator_converters import constants
  from .supported import get_sklearn_api_operator_name, get_onnxml_api_operator_name, get_sparkml_api_operator_name
label_desc: Use image node_id 2 for calling a global function with example usage: parse_sparkml_api_model(model, extra_config) and returns: topology