class_docstr: Context manager for making an algorithm instance available to zipline API
  functions within a scoped block.
class_docstr_tok: ["Context","manager","for","making","an","algorithm","instance","available","to","zipline","API","functions","within","a","scoped","block","."]
docstr: Set the given algo instance, storing any previously-existing instance.
docstr_tok: ["Set","the","given","algo","instance",",","storing","any","previously-existing","instance","."]
code: def __enter__(self):
      """
      Set the given algo instance, storing any previously-existing instance.
      """
      self.old_algo_instance = get_algo_instance()
      set_algo_instance(self.algo_instance)
  
file_path: zipline/zipline/utils/api_support.py
imports: import zipline.api
  from zipline.utils.compat import wraps
  from zipline.utils.algo_instance import get_algo_instance, set_algo_instance
label_desc: Use image node_id 2 for calling the ZiplineAPI obj's underlying member method code with example usage: obj.__enter__() without return types