code: def lazy(func):
      result = _Result()
  
      lock = threading.Lock()
  
      @functools.wraps(func)
      def wrapper(*args):
          try:
              return result.result
          except AttributeError:
              with lock:
                  try:
                      return result.result
                  except AttributeError:
                      result.result = func(*args)
  
              return result.result
  
      return wrapper
  
imports: import functools
  import threading
  import collections
  import contextlib
  import six
label_desc: Use image node_id 3 for calling a global function with example usage: lazy(func) and returns: wrapper, result, result, result