def METHOD_NAME(self, django_user):
    """
    A function that returns an XBlockUser from the current Django request.user
    """
    xblock_user = XBlockUser(is_current_user=True)
    if django_user is not None and django_user.is_authenticated:
        # This full_name is dependent on edx-platform's profile implementation
        if hasattr(django_user, 'profile'):
            full_name = django_user.profile.name
        else:
            full_name = None
        xblock_user.full_name = full_name
        xblock_user.emails = [django_user.email]
        xblock_user.opt_attrs[ATTR_KEY_ANONYMOUS_USER_ID] = self._anonymous_user_id
        xblock_user.opt_attrs[ATTR_KEY_DEPRECATED_ANONYMOUS_USER_ID] = self._deprecated_anonymous_user_id
        xblock_user.opt_attrs[ATTR_KEY_IS_AUTHENTICATED] = True
        xblock_user.opt_attrs[ATTR_KEY_REQUEST_COUNTRY_CODE] = self._request_country_code
        xblock_user.opt_attrs[ATTR_KEY_USER_ID] = django_user.id
        xblock_user.opt_attrs[ATTR_KEY_USERNAME] = django_user.username
        xblock_user.opt_attrs[ATTR_KEY_USER_IS_BETA_TESTER] = self._user_is_beta_tester
        xblock_user.opt_attrs[ATTR_KEY_USER_IS_GLOBAL_STAFF] = self._user_is_global_staff
        xblock_user.opt_attrs[ATTR_KEY_USER_IS_STAFF] = self._user_is_staff
        xblock_user.opt_attrs[ATTR_KEY_USER_ROLE] = self._user_role
        user_preferences = get_user_preferences(django_user)
        xblock_user.opt_attrs[ATTR_KEY_USER_PREFERENCES] = {
            pref: user_preferences.get(pref)
            for pref in USER_PREFERENCES_WHITE_LIST
            if pref in user_preferences
        }
    else:
        xblock_user.opt_attrs[ATTR_KEY_IS_AUTHENTICATED] = False
        xblock_user.opt_attrs[ATTR_KEY_REQUEST_COUNTRY_CODE] = self._request_country_code
    return xblock_user