def set_trace(a_frame=None):
    """ Breaks on the line that invoked this function or at given frame.
    User can then resume execution.
    
    To call set_trace() use:
    
    .. code-block:: python

        import ikp3db ; ikp3db.set_trace()

    :param a_frame: The frame at which to break on.
    :type a_frame: frame
    
    :return: An error message or None is everything went fine.
    :rtype: str or None

    """
    if not ikpdb:
        return "Error: IKP3db must be launched before calling ikpd.set_trace()."

    if a_frame is None:
        a_frame = sys._getframe().f_back
    ikpdb._line_tracer(a_frame)
    return None
Breaks on the line that invoked this function or at given frame.
    User can then resume execution.
    
    To call set_trace() use:
    
    .. code-block:: python

        import ikp3db ; ikp3db.set_trace()

    :param a_frame: The frame at which to break on.
    :type a_frame: frame
    
    :return: An error message or None is everything went fine.
    :rtype: str or None