code: def get_divide_kernel(
      context,
      dtype_x,
      dtype_y,
      dtype_z,
      x_is_scalar=False,
      y_is_scalar=False,
  ):
      x_is_complex = dtype_x.kind == "c"
      y_is_complex = dtype_y.kind == "c"
      z_is_complex = dtype_z.kind == "c"
  
      x = "x[0]" if x_is_scalar else "x[i]"
      y = "y[0]" if y_is_scalar else "y[i]"
  
      if z_is_complex and dtype_x != dtype_y:
          if x_is_complex and dtype_x != dtype_z:
              x = "{}_cast({})".format(
                  complex_dtype_to_name(dtype_z), x
              )
          if y_is_complex and dtype_y != dtype_z:
              y = "{}_cast({})".format(
                  complex_dtype_to_name(dtype_z), y
              )
      else:
          if dtype_x != dtype_z:
              x = f"({dtype_to_ctype(dtype_z)}) ({x})"
          if dtype_y != dtype_z:
              y = f"({dtype_to_ctype(dtype_z)}) ({y})"
  
      if x_is_complex and y_is_complex:
          xoy = "{}_divide({}, {})".format(
              complex_dtype_to_name(dtype_z), x, y
          )
      elif not x_is_complex and y_is_complex:
          xoy = "{}_rdivide({}, {})".format(
              complex_dtype_to_name(dtype_z), x, y
          )
      elif x_is_complex and not y_is_complex:
          xoy = "{}_divider({}, {})".format(
              complex_dtype_to_name(dtype_z), x, y
          )
      else:
          xoy = f"{x} / {y}"
  
      if z_is_complex:
          xoy = "{}_cast({})".format(
              complex_dtype_to_name(dtype_z), xoy
          )
  
      return get_elwise_kernel(
          context,
          "{tp_z} *z, {tp_x} *x, {tp_y} *y".format(
              tp_x=dtype_to_ctype(dtype_x),
              tp_y=dtype_to_ctype(dtype_y),
              tp_z=dtype_to_ctype(dtype_z),
          ),
          f"z[i] = {xoy}",
          name="divide",
      )
  
imports: import enum
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import pyopencl
  from pyopencl.tools import context_dependent_memoize
  from pyopencl.tools import dtype_to_ctype, DtypedArgument, VectorArg, ScalarArg, KernelTemplateBase, dtype_to_c_struct
  from pytools import memoize_method
label_desc: Use image node_id 15 for calling a global function with example usage: get_divide_kernel(context, dtype_x, dtype_y, dtype_z, x_is_scalar, y_is_scalar) and returns: get_elwise_kernel