
    Design a function that determines the minimum group capacity needed for the school's peer mentoring program, where capacity must be a power of 2 to maintain balanced mentor-mentee pairs, given the current number of at-risk students. The determined capacity should be large enough to accommodate all current students while maintaining the power-of-2 structure for effective program organization.
    

    
def next_power_of_2(n):
    """
    Design a function that determines the minimum group capacity needed for the school's peer mentoring program, where capacity must be a power of 2 to maintain balanced mentor-mentee pairs, given the current number of at-risk students. The determined capacity should be large enough to accommodate all current students while maintaining the power-of-2 structure for effective program organization.
    

    """
def next_power_of_2(n):
    """
    Design a function that determines the minimum group capacity needed for the school's peer mentoring program, where capacity must be a power of 2 to maintain balanced mentor-mentee pairs, given the current number of at-risk students. The determined capacity should be large enough to accommodate all current students while maintaining the power-of-2 structure for effective program organization.
    

    """
    if n and (not n & n - 1):
        return n
    count = 0
    while n != 0:
        n >>= 1
        count += 1
    return 1 << count