code: def synchronized(func):
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          with _module_lock:
              return func(*args, **kwargs)
  
      return wrapper
  
file_path: scipy/scipy/optimize/_cobyla_py.py
imports: import functools
  from threading import RLock
  import numpy
  from scipy.optimize import _cobyla
  from ._optimize import OptimizeResult, _check_unknown_options, _prepare_scalar_function
label_desc: Use image node_id 1 for calling a global function with example usage: synchronized(func) and returns: wrapper, func