code: def lazy(func):
      
      try:
          frame = sys._getframe(1)
      except Exception:
          _locals = None
      else:
          _locals = frame.f_locals
      func_name = func.func_name if six.PY2 else func.__name__
      return LazyStub(func_name, func, _locals)
docs: Decorator, which can be used for lazy imports
  
              @lazy
              def yaml():
                  import yaml
                  return yaml