code: def create_unary_identifier_func(id_func):
      """
      Provide a wrapper around numba's low-level extension API which
      produces the boilerplate needed to implement a unary function
      of a string.
      """
  
      def deco(cuda_func):
          @cuda_lower(f"StringView.{id_func}", string_view)
          @cuda_lower(f"UDFString.{id_func}", string_view)
          def id_func_impl(context, builder, sig, args):
              str_ptr = builder.alloca(args[0].type)
              builder.store(args[0], str_ptr)
  
              # Lookup table required for conversion functions
              # must be resolved at runtime after context initialization,
              # therefore cannot be a global variable
              tbl_ptr = context.get_constant(
                  types.uintp, get_character_flags_table_ptr()
              )
              result = context.compile_internal(
                  builder,
                  cuda_func,
                  nb_signature(
                      types.boolean, _STR_VIEW_PTR, types.uintp
                  ),
                  (str_ptr, tbl_ptr),
              )
  
              return result
  
          return id_func_impl
  
      return deco
  
imports: import operator
  from functools import partial
  from numba import cuda, types
  from numba.core import cgutils
  from numba.core.datamodel import default_manager
  from numba.core.typing import signature
  from numba.cuda.cudaimpl import lower, registry
  from cudf._lib.strings_udf import get_character_cases_table_ptr, get_character_flags_table_ptr, get_special_case_mapping_table_ptr
  from cudf.core.udf.masked_typing import MaskedType
  from cudf.core.udf.strings_typing import size_type, string_view, udf_string
label_desc: Use image node_id 31 for calling a global function with example usage: create_unary_identifier_func(id_func) and returns: deco, id_func_impl, result