code: def quit_with_gc(func_or_gen):
      """A decorator function attaching garbage collection
      at the end of the function.
  
      Args:
          func_or_gen (function or int): If an int is given, it returns a decorator with garbage collection with generation=2 for gc.collect(generation) with the specified value as generation.
  
      """
      generation = 2
  
      def _quit_with_gc(f):
          def decorated(*args, **kw):
              import gc
  
              ret = f(*args, **kw)
              gc.collect(generation)
              return ret
  
          return decorated
  
      if isinstance(func_or_gen, int):
          generation = func_or_gen
          return _quit_with_gc
      func = func_or_gen
      return _quit_with_gc(func)
  
imports: from nnabla.utils import nnabla_pb2
  from six.moves import filter
  import copy
  import nnabla
  import nnabla.ext_utils
  import nnabla.functions
  import nnabla.utils.converter
  import nnabla.dtypes
  from nnabla.testing import assert_allclose
  import numpy
  import numpy
  import platform
label_desc: Use image node_id 7 for calling a global function with example usage: quit_with_gc(func_or_gen) and returns: _quit_with_gc, decorated, _quit_with_gc, ret