code: def __enter__(self):
      mode_name_to_old_value = dict()
      for mode_name, value in self.mode_name_to_value.items():
          # record mode's old values
          mode_name_to_old_value[mode_name] = getattr(
              _internal_mode, mode_name, None
          )
          if value is None:
              continue
          # set value
          setattr(_internal_mode, mode_name, value)
      self.mode_name_to_value_list.append(mode_name_to_old_value)
  
file_path: mars/mars/core/mode.py
imports: import functools
  import inspect
  import threading
  from ..config import options
label_desc: Use image node_id 2 for calling the _EnterModeFuncWrapper obj's underlying member method code with example usage: obj.__enter__() without return types