'Get the anonymous user id for a user.
Args:
username(str): username of a user.
course_id(str): course id of particular course.
Returns:
A unique anonymous_user_id for (user, course) pair.
None for Non-staff users.'

def get_anonymous_user_id(self, username, course_id):

    if (not self.get_current_user().opt_attrs.get(ATTR_KEY_USER_IS_STAFF)):
        return None
    try:
        user = get_user_by_username_or_email(username_or_email=username)
    except User.DoesNotExist:
        return None
    course_id = CourseKey.from_string(course_id)
    return anonymous_id_for_user(user=user, course_id=course_id, save=False)
