code: def from_arrow_schema(
      arrow_schema: "pa.Schema", prefer_timestamp_ntz: bool = False
  ) -> StructType:
      """Convert schema from Arrow to Spark."""
      return StructType(
          [
              StructField(
                  field.name,
                  from_arrow_type(field.type, prefer_timestamp_ntz),
                  nullable=field.nullable,
              )
              for field in arrow_schema
          ]
      )
  
imports: import datetime
  import itertools
  from typing import Any, Callable, Iterable, List, Optional, Union, TYPE_CHECKING
  from pyspark.sql.types import cast, BooleanType, ByteType, ShortType, IntegerType, IntegralType, LongType, FloatType, DoubleType, DecimalType, StringType, BinaryType, DateType, TimestampType, TimestampNTZType, DayTimeIntervalType, ArrayType, MapType, StructType, StructField, NullType, DataType, UserDefinedType, _create_row
  from pyspark.errors import PySparkTypeError, UnsupportedOperationException, PySparkValueError
label_desc: Use image node_id 4 for calling a global function with example usage: from_arrow_schema(arrow_schema, prefer_timestamp_ntz) and returns: StructType