class_docstr: A helper context for changing environment variables temporarily.
  
  Usage:
  ```
  with EnvContext():
      os.environ["KMP_AFFINITY"] = "x"
      ...
  ```
  or
  ```
  with EnvContext({"KMP_AFFINITY": "x"}):
      ...
  ```
  After exiting this context, `os.environ` will be restored to initial state.
class_docstr_tok: ["A","helper","context","for","changing","environment","variables","temporarily",".","Usage",":","``","`","with","EnvContext","(",")",":","os.environ","[","``","KMP_AFFINITY","''","]","=","``","x","''","...","``","`","or","``","`","with","EnvContext","(","{","``","KMP_AFFINITY","''",":","``","x","''","}",")",":","...","``","`","After","exiting","this","context",",","`","os.environ","`","will","be","restored","to","initial","state","."]
code: def __init__(self, env: Optional[Dict[str, str]] = None) -> None:
      self.env_backup = os.environ.copy()
      self.new_env = env
  
file_path: BigDL/python/nano/src/bigdl/nano/utils/common/env.py
imports: import os
  import subprocess
  import warnings
  from typing import Union, Dict, Optional
label_desc: Use image node_id 1 to create a new EnvContext object from inherited base classes: object with example: obj = EnvContext(env)