code: def make_const_op(op):
      def masked_scalar_const_op_impl(context, builder, sig, args):
          return_type = sig.return_type
          result = cgutils.create_struct_proxy(return_type)(
              context, builder
          )
          result.valid = context.get_constant(types.boolean, 0)
          if isinstance(sig.args[0], MaskedType):
              masked_type, const_type = sig.args
              masked_value, const_value = args
  
              indata = cgutils.create_struct_proxy(masked_type)(
                  context, builder, value=masked_value
              )
              nb_sig = nb_signature(
                  return_type.value_type,
                  masked_type.value_type,
                  const_type,
              )
              compile_args = (indata.value, const_value)
          else:
              const_type, masked_type = sig.args
              const_value, masked_value = args
              indata = cgutils.create_struct_proxy(masked_type)(
                  context, builder, value=masked_value
              )
              nb_sig = nb_signature(
                  return_type.value_type,
                  const_type,
                  masked_type.value_type,
              )
              compile_args = (const_value, indata.value)
          with builder.if_then(indata.valid):
              result.value = context.compile_internal(
                  builder, lambda x, y: op(x, y), nb_sig, compile_args
              )
              result.valid = context.get_constant(types.boolean, 1)
          return result._getvalue()
  
      return masked_scalar_const_op_impl
  
imports: import operator
  from llvmlite import ir
  from numba.core import cgutils
  from numba.core.typing import signature
  from numba.cuda.cudaimpl import lower, registry
  from numba.extending import lower_builtin, types
  from cudf.core.udf import api
  from cudf.core.udf._ops import arith_ops, bitwise_ops, comparison_ops, unary_ops
  from cudf.core.udf.masked_typing import MaskedType, NAType, _supported_masked_types
label_desc: Use image node_id 7 for calling a global function with example usage: make_const_op(op) and returns: masked_scalar_const_op_impl, result