code: def _set_strategy(_strategy: str) -> None:
      if not is_available():
          raise ValueError(
              f"opt_einsum is not available, so setting `strategy` to {_strategy} will not be meaningful. "
              "torch.einsum will bypass path calculation and simply contract from left to right. "
              "Please install opt_einsum or unset `strategy`."
          )
      if not enabled:
          raise ValueError(
              f"opt_einsum is not enabled, so setting a `strategy` to {_strategy} will not be meaningful. "
              "torch.einsum will bypass path calculation and simply contract from left to right. "
              "Please set `enabled` to `True` as well or unset `strategy`."
          )
      if _strategy not in ["auto", "greedy", "optimal"]:
          raise ValueError(
              f"`strategy` must be one of the following: [auto, greedy, optimal] but is {_strategy}"
          )
      global strategy
      strategy = _strategy
  
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 5 for calling a global function with example usage: _set_strategy(_strategy) without return types