docs: def complex_handle_errors():
      """
      This function demonstrates a more complex usage of the handle_errors
      ctx_mgr. The following features are demonstrated::
  
        * Handling a specific exception type with ``exception_class``
        * Absorbing exceptions by setting ``re_raise`` to ``False``
        * Branching with ``do_except``, ``do_else``, and ``do_finally``
      """
      print("Demonstrating complex handle_errors example")
  
      def _handler_function(err, final_message, trace):
          """
          This function is a helper function for handling an exception from
          the handle_errors ctx_mgr.
          """
          print("Handling exception")
          print("==================")
          print("Final Message")
          print("-------------")
          print(final_message)
          print("Traceback")
          print("---------")
          print(''.join(format_tb(trace)))
  
      with HandleError.handle_errors(
              "something went wrong ({example_type})",
              example_type='complex example',
              re_raise=False,
              do_except=_handler_function,
              do_else=lambda: print('No exception occurred'),
              do_finally=lambda: print('Finished handling exceptions'),
      ):
          print("we are fine")
          raise ValueError("here we die")
          print("we should not get here")