()
A context manager that freezes the stack trace.

  AVOID USING THIS CONTEXT MANAGER OUTSIDE OF INTERNAL PYMJCF IMPLEMENTATION,
  AS IT REDUCES THE USEFULNESS OF DEBUG MODE.

  If PyMJCF debug mode is enabled, calls to `debugging.get_current_stack_trace`
  within this context will always return the stack trace from when this context
  was entered.

  The frozen stack is global to this debugging module. That is, if the context
  is entered while another one is still active, then the stack trace of the
  outermost one is returned.

  This context significantly speeds up bulk operations in debug mode, e.g.
  parsing an existing XML string or creating a deeply-nested element, as it
  prevents the same stack trace from being repeatedly constructed.

  Yields:
    `None`
A context manager that freezes the stack trace.
A context manager that freezes the stack trace .
def freeze_current_stack_trace():
  """A context manager that freezes the stack trace.

  AVOID USING THIS CONTEXT MANAGER OUTSIDE OF INTERNAL PYMJCF IMPLEMENTATION,
  AS IT REDUCES THE USEFULNESS OF DEBUG MODE.

  If PyMJCF debug mode is enabled, calls to `debugging.get_current_stack_trace`
  within this context will always return the stack trace from when this context
  was entered.

  The frozen stack is global to this debugging module. That is, if the context
  is entered while another one is still active, then the stack trace of the
  outermost one is returned.

  This context significantly speeds up bulk operations in debug mode, e.g.
  parsing an existing XML string or creating a deeply-nested element, as it
  prevents the same stack trace from being repeatedly constructed.

  Yields:
    `None`
  """
  global _CURRENT_FROZEN_STACK
  if debug_mode() and _CURRENT_FROZEN_STACK is None:
    _CURRENT_FROZEN_STACK = _get_actual_current_stack_trace()
    yield
    _CURRENT_FROZEN_STACK = None
  else:
    yield
def freeze_current_stack_trace ( ) : global _CURRENT_FROZEN_STACK if debug_mode ( ) and _CURRENT_FROZEN_STACK is None : _CURRENT_FROZEN_STACK = _get_actual_current_stack_trace ( ) yield _CURRENT_FROZEN_STACK = None else : yield