original_docstring: Context manager for managing changes to state.
  
          This context manager provides two functions:
          - Make a group of assignments to state atomically: if an exception occurs,
          all changes will be rolled back.
          - Renders changes to the state upon successful completion.
  
          Note that this context manager will not keep track of changes to mutable objects.
  
          Args:
              ignored_variables: an optional sequence of variables for the manager to ignore.
                                 These changes will not be reverted upon exception.
          
docstring: Context manager for managing changes to state.
  This context manager provides two functions:
  Make a group of assignments to state atomically: if an exception occurs,
  all changes will be rolled back.
  Renders changes to the state upon successful completion.
  
  Note that this context manager will not keep track of changes to mutable objects.
docstring_tokens: Context manager for managing changes to state . This context manager provides two functions : Make a group of assignments to state atomically : if an exception occurs all changes will be rolled back . Renders changes to the state upon successful completion . Note that this context manager will not keep track of changes to mutable objects .
code: def render_changes(self, ignored_variables: tp.Optional[tp.Sequence[tp.Text]] = None):
          """Context manager for managing changes to state.
  
          This context manager provides two functions:
          - Make a group of assignments to state atomically: if an exception occurs,
          all changes will be rolled back.
          - Renders changes to the state upon successful completion.
  
          Note that this context manager will not keep track of changes to mutable objects.
  
          Args:
              ignored_variables: an optional sequence of variables for the manager to ignore.
                                 These changes will not be reverted upon exception.
          """
          entered = False
          ignored_variables = ignored_variables or set()
          ignored_variables = set(ignored_variables)
          exception_raised = False
          if self._render_changes_context is None:
              super().__setattr__("_render_changes_context", {})
              super().__setattr__("_render_unwind_context", {})
              super().__setattr__("_ignored_variables", ignored_variables)
              entered = True
          try:
              yield
          except Exception as e:
              exception_raised = True
              raise e
          finally:
              if entered:
                  changes_context = self._render_changes_context
                  unwind_context = self._render_unwind_context
                  super().__setattr__("_render_changes_context", None)
                  super().__setattr__("_render_unwind_context", None)
                  super().__setattr__("_ignored_variables", set())
                  for k, v in unwind_context.items():
                      super().__setattr__(k, v)
                  if not exception_raised:
                      self.set_state(**changes_context)
code_tokens: def render_changes ( self , ignored_variables : tp . Optional [ tp . Sequence [ tp . Text ] ] = None ) : entered = False ignored_variables = ignored_variables or set ( ) ignored_variables = set ( ignored_variables ) exception_raised = False if self . _render_changes_context is None : super ( ) . __setattr__ ( "_render_changes_context" , { } ) super ( ) . __setattr__ ( "_render_unwind_context" , { } ) super ( ) . __setattr__ ( "_ignored_variables" , ignored_variables ) entered = True try : yield except Exception as e : exception_raised = True raise e finally : if entered : changes_context = self . _render_changes_context unwind_context = self . _render_unwind_context super ( ) . __setattr__ ( "_render_changes_context" , None ) super ( ) . __setattr__ ( "_render_unwind_context" , None ) super ( ) . __setattr__ ( "_ignored_variables" , set ( ) ) for k , v in unwind_context . items ( ) : super ( ) . __setattr__ ( k , v ) if not exception_raised : self . set_state ( ** changes_context )
short_docstring: Context manager for managing changes to state.
short_docstring_tokens: Context manager for managing changes to state .
comment: """Context manager for managing changes to state.
  
          This context manager provides two functions:
          - Make a group of assignments to state atomically: if an exception occurs,
          all changes will be rolled back.
          - Renders changes to the state upon successful completion.
  
          Note that this context manager will not keep track of changes to mutable objects.
  
          Args:
              ignored_variables: an optional sequence of variables for the manager to ignore.
                                 These changes will not be reverted upon exception.
          """