code: def _pyudf(func, use_pandas):
      from pyspark.sql.functions import pandas_udf, PandasUDFType, udf
  
      return (
          pandas_udf(func, t.DoubleType(), PandasUDFType.SCALAR)
          if use_pandas
          else udf(func, t.DoubleType())
      )
  
imports: from abc import ABC, abstractmethod
  from typing import Callable, Dict, List, Optional, Union
  from synapse.ml.cyber.utils.spark_utils import ExplainBuilder, HasSetInputCol, HasSetOutputCol
  from pyspark.ml import Estimator, Transformer
  from pyspark.ml.param.shared import HasInputCol, HasOutputCol, Param, Params
  from pyspark.sql import DataFrame, functions, types
label_desc: Use image node_id 1 for calling a global function with example usage: _pyudf(func, use_pandas) and returns: unknown