def get_virtualenv_prefix():
    """
    :return: Returns a tuple where the first element is the name of the attribute
             where we retrieved the virtualenv prefix from. The second element is
             the virtualenv prefix.
    """
    if hasattr(sys, "real_prefix"):
        return ("sys.real_prefix", sys.real_prefix)
    elif hasattr(sys, "base_prefix"):
        return ("sys.base_prefix", sys.base_prefix)
    return (None, None)

    :return: Returns a tuple where the first element is the name of the attribute
             where we retrieved the virtualenv prefix from. The second element is
             the virtualenv prefix.
    
st2common/st2common/util/sandboxing.py