code: def createSchema(
      schemaDesc,  # Seq[(String,DataType)],
      featureNames,  # Seq[String],
      addFeatureNamesMetadata=True,  # Boolean = true,
      nullableFields=[],  # Seq[String] = Seq(),
      catFeaturesNumValues={},  # Map[String,Int] = Map[String,Int](),
      catFeaturesValues={},  #: Map[String,Seq[String]] = Map[String,Seq[String]]()
  ):  #: Seq[StructField] = {
      result = []
      for name, dataType in schemaDesc:
          if addFeatureNamesMetadata and (
              (name == "features") or (name == "f1")
          ):
              numericAttrs = []
              nominalAttrs = []
  
              for i, fname in enumerate(featureNames):
                  if fname in catFeaturesNumValues:
                      nominalAttrs.append(
                          {
                              "num_vals": catFeaturesNumValues[fname],
                              "idx": i,
                              "name": fname,
                          }
                      )
                  if fname in catFeaturesValues:
                      nominalAttrs.append(
                          {
                              "vals": catFeaturesValues[fname],
                              "idx": i,
                              "name": fname,
                          }
                      )
                  else:
                      numericAttrs.append({"idx": i, "name": fname})
  
              attrs = {}
              if numericAttrs:
                  attrs["numeric"] = numericAttrs
              if nominalAttrs:
                  attrs["nominal"] = nominalAttrs
  
              metadata = {
                  "ml_attr": {
                      "attrs": attrs,
                      "num_attrs": len(featureNames),
                  }
              }
  
              result.append(
                  StructField(
                      name, dataType, name in nullableFields, metadata
                  )
              )
          else:
              result.append(
                  StructField(name, dataType, name in nullableFields)
              )
      return result
  
file_path: catboost/catboost/spark/catboost4j-spark/core/src/test/python/pool_test_helpers.py
imports: import tempfile
  from pyspark.ml.linalg import *
  from pyspark.ml.param import *
  from pyspark.sql import *
  from pyspark.sql.types import *
  import test_helpers
label_desc: Use image node_id 1 for calling a global function with example usage: createSchema(schemaDesc, featureNames, addFeatureNamesMetadata, nullableFields, catFeaturesNumValues, catFeaturesValues) and returns: result