code: def framework_from_env() -> framework_type:
      framework = os.getenv(ENV_NNI_FRAMEWORK, "pytorch")
      if framework not in framework_type.__args__:  # type: ignore
          raise ValueError(f"{framework} does not belong to {framework_type.__args__}")  # type: ignore
      return cast(framework_type, framework)
  
file_path: nni/nni/common/framework.py
imports: import importlib
  import os
  import sys
  from typing import Optional, cast
  from typing_extensions import Literal
label_desc: Use image node_id 1 for calling a global function with example usage: framework_from_env() and returns: cast