code: def masked_scalar_cast_impl(context, builder, sig, args):
      input = cgutils.create_struct_proxy(sig.args[0])(
          context, builder, value=args[0]
      )
      result = cgutils.create_struct_proxy(sig.return_type)(
          context, builder
      )
  
      casted = context.cast(
          builder,
          input.value,
          sig.args[0].value_type,
          sig.return_type.value_type,
      )
      result.value = casted
      result.valid = input.valid
      return result._getvalue()
  
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 13 for calling a global function with example usage: masked_scalar_cast_impl(context, builder, sig, args) and returns: result