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 __enter__(self):
      if self.new_env is not None:
          os.environ.update(self.new_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 2 for calling the EnvContext obj's underlying member method code with example usage: obj.__enter__() without return types