code: def handle_scope(self, node, scope):
      # For all buffers, insert extra variables in the scope.
      # The variables are also accessible from the buffer_info
      # on the buffer entry
      scope_items = scope.entries.items()
      bufvars = [
          entry for name, entry in scope_items if entry.type.is_buffer
      ]
      if len(bufvars) > 0:
          bufvars.sort(key=lambda entry: entry.name)
          self.buffers_exists = True
  
      memviewslicevars = [
          entry
          for name, entry in scope_items
          if entry.type.is_memoryviewslice
      ]
      if len(memviewslicevars) > 0:
          self.buffers_exists = True
  
      for name, entry in scope_items:
          if name == "memoryview" and isinstance(
              entry.utility_code_definition, CythonUtilityCode
          ):
              self.using_memoryview = True
              break
      del scope_items
  
      if isinstance(node, ModuleNode) and len(bufvars) > 0:
          # for now...note that pos is wrong
          raise CompileError(
              node.pos, "Buffer vars not allowed in module scope"
          )
      for entry in bufvars:
          if entry.type.dtype.is_ptr:
              raise CompileError(
                  node.pos,
                  "Buffers with pointer types not yet supported.",
              )
  
          name = entry.name
          buftype = entry.type
          if buftype.ndim > Options.buffer_max_dims:
              raise CompileError(
                  node.pos,
                  "Buffer ndims exceeds Options.buffer_max_dims = %d"
                  % Options.buffer_max_dims,
              )
          if buftype.ndim > self.max_ndim:
              self.max_ndim = buftype.ndim
  
          # Declare auxiliary vars
          def decvar(type, prefix):
              cname = scope.mangle(prefix, name)
              aux_var = scope.declare_var(
                  name=None, cname=cname, type=type, pos=node.pos
              )
              if entry.is_arg:
                  aux_var.used = True  # otherwise, NameNode will mark whether it is used
  
              return aux_var
  
          auxvars = (
              (
                  PyrexTypes.c_pyx_buffer_nd_type,
                  Naming.pybuffernd_prefix,
              ),
              (
                  PyrexTypes.c_pyx_buffer_type,
                  Naming.pybufferstruct_prefix,
              ),
          )
          pybuffernd, rcbuffer = [
              decvar(type, prefix) for (type, prefix) in auxvars
          ]
  
          entry.buffer_aux = Symtab.BufferAux(pybuffernd, rcbuffer)
  
      scope.buffer_entries = bufvars
      self.scope = scope
  
imports: from __future__ import absolute_import
  from .Visitor import CythonTransform
  from .ModuleNode import ModuleNode
  from .Errors import CompileError
  from .UtilityCode import CythonUtilityCode
  from .Code import UtilityCode, TempitaUtilityCode
  from .None import Options
  from .None import Interpreter
  from .None import PyrexTypes
  from .None import Naming
  from .None import Symtab
label_desc: Use image node_id 2 for calling the IntroduceBufferAuxiliaryVars obj's underlying member method code with example usage: obj.handle_scope(node, scope) and returns: aux_var