code: def train(dataset, steps=1000, lr=0.001):
      model = get_compiled_model(lr=lr)
      model.fit(dataset, steps_per_epoch=steps)
      return model
  
imports: import logging
  from pyspark.sql import SparkSession
  from examples.spark_dataset_converter.utils import get_mnist_dir
  from petastorm.spark import SparkDatasetConverter, make_spark_converter
label_desc: Use image node_id 2 for calling a global function with example usage: train(dataset, steps, lr) and returns: model