code: def _set_enabled(_enabled: bool) -> None:
      if not is_available() and _enabled:
          raise ValueError(
              f"opt_einsum is not available, so setting `enabled` to {_enabled} will not reap "
              "the benefits of calculating an optimal path for einsum. torch.einsum will "
              "fall back to contracting from left to right. To enable this optimal path "
              "calculation, please install opt-einsum."
          )
      global enabled
      enabled = _enabled
  
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 3 for calling a global function with example usage: _set_enabled(_enabled) without return types