class_docstr: Wrapper for data source registration. This instance can be accessed by
  :attr:`spark.dataSource`.
  
  .. versionadded: 4.0.0
docstr: Register a Python user-defined data source.
  
  Parameters
  ----------
  dataSource : type
      The data source class to be registered. It should be a subclass of DataSource.
code: def register(
      self,
      dataSource: Type["DataSource"],
  ) -> None:
      """Register a Python user-defined data source.
  
      Parameters
      ----------
      dataSource : type
          The data source class to be registered. It should be a subclass of DataSource.
      """
      from pyspark.sql.udf import _wrap_function
  
      name = dataSource.name()
      sc = self.sparkSession.sparkContext
      # Serialize the data source class.
      wrapped = _wrap_function(sc, dataSource)
      assert sc._jvm is not None
      jvm = sc._jvm
      ds = jvm.org.apache.spark.sql.execution.datasources.v2.python.UserDefinedPythonDataSource(
          wrapped
      )
      self.sparkSession._jsparkSession.dataSource().registerPython(
          name, ds
      )
  
imports: from abc import ABC, abstractmethod
  from collections import UserDict
  from typing import Any, Dict, Iterator, List, Sequence, Tuple, Type, Union, TYPE_CHECKING
  from pyspark.sql import Row
  from pyspark.sql.types import StructType
  from pyspark.errors import PySparkNotImplementedError
label_desc: Use image node_id 2 for calling the DataSourceRegistration obj's underlying member method code with example usage: obj.register(dataSource) without return types