code: def maybe_dispatch_ufunc_to_spark_func(
      ser_or_index: IndexOpsMixin,
      ufunc: Callable,
      method: str,
      *inputs: Any,
      **kwargs: Any,
  ) -> IndexOpsMixin:
      from pyspark.pandas.base import column_op
  
      op_name = ufunc.__name__
  
      if (
          method == "__call__"
          and (
              op_name in unary_np_spark_mappings
              or op_name in binary_np_spark_mappings
          )
          and kwargs.get("out") is None
      ):
          np_spark_map_func = unary_np_spark_mappings.get(
              op_name
          ) or binary_np_spark_mappings.get(op_name)
  
          @no_type_check
          def convert_arguments(*args):
              args = [F.lit(inp) for inp in args]
              return np_spark_map_func(*args)
  
          return column_op(convert_arguments)(*inputs)
      else:
          return NotImplemented
  
file_path: spark/python/pyspark/pandas/numpy_compat.py
imports: from typing import Any, Callable, no_type_check
  import numpy
  from pyspark.sql import functions
  from pyspark.sql.pandas.functions import pandas_udf
  from pyspark.sql.types import DoubleType, LongType, BooleanType
  from pyspark.pandas.base import IndexOpsMixin
label_desc: Use image node_id 2 for calling a global function with example usage: maybe_dispatch_ufunc_to_spark_func(ser_or_index, ufunc, method) and returns: column_op, NotImplemented, np_spark_map_func