class_docstr: Represents an adapter setup of a model including active adapters and active heads. This class is intended to be
  used as a context manager using the ``with`` statement. The setup defined by the ``AdapterSetup`` context will
  override static adapter setups defined in a model (i.e. setups specified via ``active_adapters``).
  
  Example::
  
      with AdapterSetup(Stack("a", "b")):
          # will use the adapter stack "a" and "b" outputs = model(**inputs)
  
  Note that the context manager is thread-local, i.e. it can be used with different setups in a multi-threaded
  environment.
class_docstr_tok: ["Represents","an","adapter","setup","of","a","model","including","active","adapters","and","active","heads",".","This","class","is","intended","to","be","used","as","a","context","manager","using","the","``","with","``","statement",".","The","setup","defined","by","the","``","AdapterSetup","``","context","will","override","static","adapter","setups","defined","in","a","model","(","i.e",".","setups","specified","via","``","active_adapters","``",")",".","Example",":",":","with","AdapterSetup","(","Stack","(","``","a","''",",","``","b","''",")",")",":","#","will","use","the","adapter","stack","``","a","''","and","``","b","''","outputs","=","model","(","*","*","inputs",")","Note","that","the","context","manager","is","thread-local",",","i.e",".","it","can","be","used","with","different","setups","in","a","multi-threaded","environment","."]
code: def get_contexts(cls):
      if not hasattr(cls.storage, "contexts"):
          cls.storage.contexts = []
      return cls.storage.contexts
  
file_path: adapters/src/adapters/context.py
imports: import functools
  import threading
  from .composition import parse_composition, parse_heads_from_composition
label_desc: Use image node_id 4 for calling the AdapterSetup obj's underlying member method code with example usage: obj.get_contexts(cls) and returns: cls