r"""
    Args:
        user_profile (UserProfile): (default = None)

    Returns:
        UserProfile: user_profile

    CommandLine:
        python -m utool.util_project --exec-ensure_user_profile --show

    Example:
        >>> # DISABLE_DOCTEST
        >>> from utool.util_project import *  # NOQA
        >>> import utool as ut
        >>> user_profile = None
        >>> user_profile = ensure_user_profile(user_profile)
        >>> result = ('user_profile = %s' % (ut.repr2(user_profile),))
        >>> print(ut.repr3(user_profile.project_dpaths))
        >>> print(result)

def ensure_user_profile(user_profile=None):
    r"""
    Args:
        user_profile (UserProfile): (default = None)

    Returns:
        UserProfile: user_profile

    CommandLine:
        python -m utool.util_project --exec-ensure_user_profile --show

    Example:
        >>> # DISABLE_DOCTEST
        >>> from utool.util_project import *  # NOQA
        >>> import utool as ut
        >>> user_profile = None
        >>> user_profile = ensure_user_profile(user_profile)
        >>> result = ('user_profile = %s' % (ut.repr2(user_profile),))
        >>> print(ut.repr3(user_profile.project_dpaths))
        >>> print(result)
    """
    global __GLOBAL_PROFILE__
    if __GLOBAL_PROFILE__ is None:
        import utool as ut
        if ut.is_developer():
            __GLOBAL_PROFILE__ = ibeis_user_profile()
        else:
            __GLOBAL_PROFILE__ = UserProfile('default')
    if user_profile is None:
        user_profile = __GLOBAL_PROFILE__
    return user_profile