def _running_under_regular_virtualenv():
    # type: () -> bool
    """Checks if sys.real_prefix is set.

    This handles virtual environments created with pypa's virtualenv.
    """
    # pypa/virtualenv case
    return hasattr(sys, 'real_prefix')
Checks if sys.real_prefix is set.

    This handles virtual environments created with pypa's virtualenv.
    
product/gradle-plugin/src/main/python/pip/_internal/utils/virtualenv.py