code: def session_end_pb(status, end_time_secs=None):
    
    if end_time_secs is None:
      end_time_secs = time.time()
  
    session_end_info = plugin_data_pb2.SessionEndInfo(status=status,
                                                      end_time_secs=end_time_secs)
    return _summary(metadata.SESSION_END_INFO_TAG,
                    plugin_data_pb2.HParamsPluginData(
                        session_end_info=session_end_info))
docs: Constructs a SessionEndInfo protobuffer.
  
    Creates a summary that contains status information for a completed
    training session. Should be exported after the training session is completed.
    One such summary per training session should be created. Each should have
    a different run.
  
    Args:
      status: A tensorboard.hparams.Status enumeration value denoting the
          status of the session.
      end_time_secs: float. The time to use as the session end time. Represented
          as seconds since the unix epoch. If None uses the current time.
  
    Returns:
      The summary protobuffer mentioned above.