code: def implTestCase(
      tmpFolderPath,
      pool,
      dataFramesOptions=None,  # Option[Map[String, String]] = None,
      dataFramesFormat=None,  # Option[String] = None,
      saveMode=None,  # Option[SaveMode] = None,
      retryCreation=False,  # : Boolean = false
  ):
      spark = test_helpers.getOrCreateSparkSession(
          test_helpers.getCurrentMethodName()
      )
      import catboost_spark
  
      savedPoolPath = tmpFolderPath + "/pool"
  
      poolWriter = pool.write
      poolReader = catboost_spark.PoolReader(spark)
      if dataFramesFormat is not None:
          poolWriter.dataFramesWriterFormat(dataFramesFormat)
          poolReader.dataFramesReaderFormat(dataFramesFormat)
  
      if dataFramesOptions is not None:
          poolWriter.dataFramesWriterOptions(dataFramesOptions)
          poolReader.dataFramesReaderOptions(dataFramesOptions)
  
      if saveMode is not None:
          poolWriter.mode(saveMode)
  
      poolWriter.save(savedPoolPath)
      if retryCreation:
          poolWriter.save(savedPoolPath)
  
      loadedPool = poolReader.load(savedPoolPath)
  
      pool_test_helpers.printPool(pool, "pool")
      pool_test_helpers.printPool(loadedPool, "loadedPool")
  
file_path: catboost/catboost/spark/catboost4j-spark/core/src/test/python/pool_serialization_test.py
imports: import tempfile
  import pytest
  import test_helpers
  import pool_test_helpers
  from pyspark.ml.linalg import Vectors, VectorUDT
  from pyspark.sql import Row
  from pyspark.sql.types import *
label_desc: Use image node_id 2 for calling a global function with example usage: implTestCase(tmpFolderPath, pool, dataFramesOptions, dataFramesFormat, saveMode, retryCreation) without return types