code: def register(
      session: SparkSession, new_session: bool = True
  ) -> SparkSession:
      """
      Register SQL extensions and py4j converters for a Spark session.
  
      Args:
          session: Spark session
          new_session: If ``True``, create a new Spark session using ``session.newSession()`` before registering
                       extensions. This may be necessary if you're using functions that register new
                       analysis rules. The new session has isolated UDFs, configurations, and temporary tables,
                       but shares the existing ``SparkContext`` and cached data.
  
      Example:
          >>> import glow
          >>> spark = glow.register(spark)
      """
      assert check_argument_types()
      sc = session._sc
      return SparkSession(
          sc,
          session._jvm.io.projectglow.Glow.register(
              session._jsparkSession, new_session
          ),
      )
  
file_path: glow/python/glow/glow.py
imports: from glow.conversions import OneDimensionalDoubleNumpyArrayConverter, TwoDimensionalDoubleNumpyArrayConverter
  from py4j import protocol
  from py4j.protocol import register_input_converter
  from pyspark import SparkContext
  from pyspark.sql import DataFrame, SQLContext, SparkSession
  from typing import Any, Dict
  from typeguard import check_argument_types, check_return_type
label_desc: Use image node_id 2 for calling a global function with example usage: register(session, new_session) and returns: SparkSession