def get_parent_context(liveaction_db):
    """
    Returns context of the parent execution.

    :return: If found the parent context else None.
    :rtype: dict
    """
    context = getattr(liveaction_db, "context", None)
    if not context:
        return None
    return context.get("parent", None)

    Returns context of the parent execution.

    :return: If found the parent context else None.
    :rtype: dict
    
st2common/st2common/services/executions.py