code: def _binarize_kernel(x_dtype):
      binarize_kernel_str = r"""({0} *x, float threshold, int x_n) {
  
      int tid = blockDim.x * blockIdx.x + threadIdx.x;
  
      if(tid >= x_n) return;
  
      {0} val = x[tid];
      if(val > threshold)
          val = 1;
      else
          val = 0;
  
      x[tid] = val;
      }"""
      return cuda_kernel_factory(
          binarize_kernel_str, (x_dtype,), "binarize_kernel"
      )
  
imports: from cuml.common.kernel_utils import cuda_kernel_factory
  import math
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: _binarize_kernel(x_dtype) and returns: cuda_kernel_factory