code: def test_memoize_thread_local():
      class Counter(object):
          def __init__(self, s):
              self.val = s
  
          def inc(self):
              self.val += 1
              return self.val
  
      @func.memoize(thread_local=True)
      def get_counter(start):
          return Counter(start)
  
      def th_inc():
          assert get_counter(0).inc() == 1
          assert get_counter(0).inc() == 2
          assert get_counter(10).inc() == 11
          assert get_counter(10).inc() == 12
  
      th_inc()
  
      th = threading.Thread(target=th_inc)
      th.start()
      th.join()
  
file_path: catboost/library/python/func/ut/test_func.py
imports: import pytest
  import multiprocessing
  import random
  import threading
  import time
  import library.python.func
label_desc: Use image node_id 7 for calling a global function with example usage: test_memoize_thread_local() and returns: Counter, self