code: def create_binary_attr(attrname, retty):
      """
      Helper function wrapping numba's low level extension API. Provides
      the boilerplate needed to register a binary function of two string
      objects as an attribute of one, e.g. `string.func(other)`.
      """
  
      class StringViewBinaryAttr(AbstractTemplate):
          key = f"StringView.{attrname}"
  
          def generic(self, args, kws):
              return nb_signature(retty, string_view, recvr=self.this)
  
      def attr(self, mod):
          return types.BoundFunction(StringViewBinaryAttr, string_view)
  
      return attr
  
imports: import operator
  import numpy
  from numba import types
  from numba.core.extending import models, register_model
  from numba.core.typing import signature
  from numba.core.typing.templates import AbstractTemplate, AttributeTemplate
  from numba.cuda.cudadecl import registry
  import rmm
label_desc: Use image node_id 2 for calling a global function with example usage: create_binary_attr(attrname, retty) and returns: attr, types, nb_signature