code: def flags(enabled=None, strategy=None):
      with __allow_nonbracketed_mutation():
          orig_flags = set_flags(enabled, strategy)
      try:
          yield
      finally:
          # recover the previous values
          with __allow_nonbracketed_mutation():
              set_flags(*orig_flags)
  
file_path: pytorch/torch/backends/opt_einsum/__init__.py
imports: import sys
  import warnings
  from contextlib import contextmanager
  from functools import lru_cache
  from typing import Any
  from torch.backends import __allow_nonbracketed_mutation, ContextProp, PropModule
label_desc: Use image node_id 8 for calling a global function with example usage: flags(enabled, strategy) without return types