code: def _get_groupby_apply_kernel(frame, func, args):
      np_field_types = np.dtype(
          list(_all_dtypes_from_frame(frame).items())
      )
      dataframe_group_type = _get_frame_groupby_type(
          np_field_types, frame.index.dtype
      )
  
      return_type = _get_udf_return_type(
          dataframe_group_type, func, args
      )
  
      # Dict of 'local' variables into which `_kernel` is defined
      global_exec_context = {
          "cuda": cuda,
          "Group": Group,
          "dataframe_group_type": dataframe_group_type,
          "types": types,
      }
      kernel_string = _groupby_apply_kernel_string_from_template(
          frame, args
      )
      kernel = _get_kernel(
          kernel_string, global_exec_context, None, func
      )
  
      return kernel, return_type
  
file_path: cudf/python/cudf/cudf/core/udf/groupby_utils.py
imports: import cupy
  import numpy
  from numba import cuda, types
  from numba.core.errors import TypingError
  from numba.cuda.cudadrv.devices import get_context
  from numba.np import numpy_support
  import cudf.core.udf.utils
  from cudf.core.udf.groupby_typing import SUPPORTED_GROUPBY_NUMPY_TYPES, Group, GroupByJITDataFrame, GroupType
  from cudf.core.udf.templates import group_initializer_template, groupby_apply_kernel_template
  from cudf.core.udf.utils import UDFError, _all_dtypes_from_frame, _compile_or_get, _get_extensionty_size, _get_kernel, _get_udf_return_type, _supported_cols_from_frame, _supported_dtypes_from_frame
  from cudf.utils._numba import _CUDFNumbaConfig
  from cudf.utils.nvtx_annotation import _cudf_nvtx_annotate
label_desc: Use image node_id 3 for calling a global function with example usage: _get_groupby_apply_kernel(frame, func, args) and returns: kernel,  return_type