def METHOD_NAME(
    enrolled_by,
    user_email,
    transition_state,
    reason,
    course_run_key=None,
):
    """
    Creates an audit item for a manual enrollment.
    Parameters:
        enrolled_by: <auth.User> of the person that is manually enrolling
        user_email: <str> email of the user being enrolled
        transition_state: <str> state of enrollment transition state from _TRANSITIONS_STATES
        reason: <str> Reason why user was manually enrolled
        course_run_key: <str> Used to link the audit enrollment to the actual enrollment
    Note: We purposefully *exclude* passing items like CourseEnrollment objects to prevent callers from needed to
    know about model level code.
    """
    if transition_state not in TRANSITION_STATES:
        raise ValueError(f"State `{transition_state}` not in allow states: `{TRANSITION_STATES}`")
    User = get_user_model()
    try:
        enrolled_user = User.objects.get(email=user_email)
    except User.DoesNotExist:
        enrolled_user = None
    if enrolled_user and course_run_key:
        enrollment = _get_course_enrollment(enrolled_user, course_run_key)
    else:
        enrollment = None
    _create_manual_enrollment_audit(
        enrolled_by,
        user_email,
        transition_state,
        reason,
        enrollment
    )