code: def register_dataframe_method(method):
      """Register a function as a method attached to the Pyspark DataFrame.
  
      !!! note
  
          Modified based on pandas_flavor.register.
  
      <!--
      # noqa: DAR101 method
      # noqa: DAR201
      -->
      """
  
      def inner(*args, **kwargs):
          class AccessorMethod:
              def __init__(self, pyspark_obj):
                  self._obj = pyspark_obj
  
              @wraps(method)
              def __call__(self, *args, **kwargs):
                  return method(self._obj, *args, **kwargs)
  
          register_dataframe_accessor(method.__name__)(AccessorMethod)
  
          return method
  
      return inner()
  
label_desc: Use image node_id 1 for calling a global function with example usage: register_dataframe_method(method) and returns: inner, method, method