code: def __call__(
      self, input_ary, output_ary=None, allocator=None, queue=None
  ):
      allocator = allocator or input_ary.allocator
      queue = queue or input_ary.queue or output_ary.queue
  
      if output_ary is None:
          output_ary = input_ary
  
      if isinstance(output_ary, (str, str)) and output_ary == "new":
          output_ary = cl.array.empty_like(
              input_ary, allocator=allocator
          )
  
      if input_ary.shape != output_ary.shape:
          raise ValueError("input and output must have the same shape")
  
      if not input_ary.flags.forc:
          raise RuntimeError(
              "ScanKernel cannot " "deal with non-contiguous arrays"
          )
  
      (n,) = input_ary.shape
  
      if not n:
          return output_ary
  
      GenericScanKernel.__call__(
          self, input_ary, output_ary, allocator=allocator, queue=queue
      )
  
      return output_ary
  
imports: from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Set, Tuple, Union
  import numpy
  import pyopencl
  import pyopencl.array
  from pyopencl.tools import KernelTemplateBase, DtypedArgument, bitlog2, context_dependent_memoize, dtype_to_ctype, get_arg_list_scalar_arg_dtypes, get_arg_offset_adjuster_code, _process_code_for_macro, _NumpyTypesKeyBuilder
  import pyopencl._mymako
  from pyopencl._cluda import CLUDA_PREAMBLE
  from pytools.persistent_dict import WriteOncePersistentDict
  import logging
label_desc: Use image node_id 3 for calling the _LegacyScanKernelBase obj's underlying member method code with example usage: obj.__call__(input_ary, output_ary, allocator, queue) and returns: output_ary, output_ary