class_docstr: Holds context information during a forward pass through a model. This class should be used via the
  ``ForwardContext.wrap()`` method.
  
  Note that the context is thread-local.
class_docstr_tok: ["Holds","context","information","during","a","forward","pass","through","a","model",".","This","class","should","be","used","via","the","``","ForwardContext.wrap","(",")","``","method",".","Note","that","the","context","is","thread-local","."]
code: def get_context(cls):
      try:
          return cls.get_contexts()[-1]
      except IndexError:
          return None
  
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 6 for calling the ForwardContext obj's underlying member method code with example usage: obj.get_context(cls) and returns: cls, None