code: def test_memoized():
      @memoized(cache=sql_archive())
      def add(x, y):
          return x + y
  
      add(1, 2)
      add(1, 2)
      add(1, 3)
      # print ("sql_cache = %s" % add.__cache__())
      _key4 = "((), " + str({"y": 3, "x": 1}) + ")"
      _key3 = "((), " + str({"y": 2, "x": 1}) + ")"
      key4_ = "((), " + str({"x": 1, "y": 3}) + ")"
      key3_ = "((), " + str({"x": 1, "y": 2}) + ")"
      assert add.__cache__() == {_key4: 4, _key3: 3} or {
          key4_: 4,
          key3_: 3,
      }
  
      @memoized(
          cache=dict_archive(cached=False)
      )  # use archive backend 'direcly'
      def add(x, y):
          return x + y
  
      add(1, 2)
      add(1, 2)
      add(1, 3)
      # print ("dict_cache = %s" % add.__cache__())
      assert add.__cache__() == {_key4: 4, _key3: 3} or {
          key4_: 4,
          key3_: 3,
      }
  
      @memoized(cache=dict())
      def add(x, y):
          return x + y
  
      add(1, 2)
      add(1, 2)
      add(1, 3)
      # print ("dict_cache = %s" % add.__cache__())
      assert add.__cache__() == {_key4: 4, _key3: 3} or {
          key4_: 4,
          key3_: 3,
      }
  
      @memoized(cache=add.__cache__())
      def add(x, y):
          return x + y
  
      add(1, 2)
      add(2, 2)
      # print ("re_dict_cache = %s" % add.__cache__())
      _key2 = "((), " + str({"y": 2, "x": 2}) + ")"
      key2_ = "((), " + str({"x": 2, "y": 2}) + ")"
      assert add.__cache__() == {_key4: 4, _key3: 3, _key2: 4} or {
          key4_: 4,
          key3_: 3,
          key2_: 4,
      }
  
      @memoized(keymap=dumps)
      def add(x, y):
          return x + y
  
      add(1, 2)
      add(1, 2)
      add(1, 3)
      # print ("pickle_dict_cache = %s" % add.__cache__())
      _pkey4 = dill.dumps(eval(_key4))
      _pkey3 = dill.dumps(eval(_key3))
      pkey4_ = dill.dumps(eval(key4_))
      pkey3_ = dill.dumps(eval(key3_))
      assert add.__cache__() == {_pkey4: 4, _pkey3: 3} or {
          pkey4_: 4,
          pkey3_: 3,
      }
  
file_path: klepto/klepto/tests/test_cache.py
imports: from klepto.safe import inf_cache
  from klepto.keymaps import picklemap
  import sys
  import dill
  from klepto.archives import cache, sql_archive, dict_archive
  from klepto import lru_cache
label_desc: Use image node_id 5 for calling a global function with example usage: test_memoized() and returns: unknown, unknown, unknown, unknown, unknown