code: def _have_pyspark():
      
      if _have_pyspark.flag is None:
          try:
              if PackageStore.get_parquet_lib() is ParquetLib.SPARK:
                  import pyspark  # pylint:disable=W0612
                  _have_pyspark.flag = True
              else:
                  _have_pyspark.flag = False
          except ImportError:
              _have_pyspark.flag = False
      return _have_pyspark.flag
docs: Check if we're running Pyspark