
    Design a function for a social event recommendation system that determines the minimum batch size (as a power of 2) needed to process event recommendations for a given number of potential attendees, ensuring efficient queue management and optimal processing capacity. The batch size must be a power of 2 and should be equal to or greater than the number of attendees to maintain system performance.
    

    
def next_power_of_2(n):
    """
    Design a function for a social event recommendation system that determines the minimum batch size (as a power of 2) needed to process event recommendations for a given number of potential attendees, ensuring efficient queue management and optimal processing capacity. The batch size must be a power of 2 and should be equal to or greater than the number of attendees to maintain system performance.
    

    """
def next_power_of_2(n):
    """
    Design a function for a social event recommendation system that determines the minimum batch size (as a power of 2) needed to process event recommendations for a given number of potential attendees, ensuring efficient queue management and optimal processing capacity. The batch size must be a power of 2 and should be equal to or greater than the number of attendees to maintain system performance.
    

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