code: def test_threading():
      import pandas as pd
  
      TEST_LEN_SHORT = 999
      TEST_LEN_LONG = 4005
      LOOPS = 1000
      THREADS = 4
  
      data_short = np.random.rand(TEST_LEN_SHORT, 5)
      data_long = np.random.rand(TEST_LEN_LONG, 5)
  
      df_short = pd.DataFrame(
          data_short, columns=["open", "high", "low", "close", "volume"]
      )
      df_long = pd.DataFrame(
          data_long, columns=["open", "high", "low", "close", "volume"]
      )
  
      total = 0
  
      def loop(i):
          nonlocal total
          if i % 2 == 0:
              df = copy.deepcopy(df_short)
          else:
              df = copy.deepcopy(df_long)
  
          for _ in range(LOOPS):
              total += 1
              df["RSI"] = abstract.RSI(df)
  
      t0 = time.time()
  
      threads = []
      for i in range(THREADS):
          t = threading.Thread(target=lambda: loop(i))
          threads.append(t)
          t.start()
  
      for t in threads:
          t.join()
  
      t1 = time.time()
      print("test_len: %d, loops: %d" % (TEST_LEN_LONG, LOOPS))
      print("%.6f" % (t1 - t0))
      print("%.6f" % ((t1 - t0) / LOOPS))
  
      assert total == THREADS * LOOPS
  
imports: import copy
  import re
  import threading
  import time
  import numpy
  import pytest
  from numpy.testing import assert_array_equal, assert_raises
  import talib
  from talib import abstract, func
label_desc: Use image node_id 17 for calling a global function with example usage: test_threading() without return types