code: def compute_once(func):
      value = None
  
      def func_wrapper():
          nonlocal value
          if value is None:
              value = func()
          return value
  
      return func_wrapper
  
file_path: xformers/xformers/__init__.py
imports: import logging
  import os
  import torch
  from .None import _cpp_lib
  from .checkpoint import checkpoint, get_optimal_checkpoint_policy, list_operators, selective_checkpoint_wrapper
label_desc: Use image node_id 1 for calling a global function with example usage: compute_once(func) and returns: func_wrapper, value