code: def synchronized(*args):
      
      if callable(args[0]):
          return decorate_synchronized(args[0], _synchronized_lock)
      else:
          def wrap(function):
              return decorate_synchronized(function, args[0])
  
          return wrap
docs: A synchronized function prevents two or more callers to interleave
      its execution preventing race conditions.
  
      The synchronized decorator accepts as optional parameter a Lock, RLock or
      Semaphore object which will be employed to ensure the function's atomicity.
  
      If no synchronization object is given, a single threading.Lock will be used.
      This implies that between different decorated function only one at a time
      will be executed.