
    Given the number of passengers waiting at a bus stop, determine the minimum bus capacity needed, where bus capacities are designed in powers of 2 (e.g., 32, 64, 128 seats), to ensure all waiting passengers can be accommodated. The transit authority needs this calculation to dispatch a bus with sufficient seating while maintaining operational efficiency.
    

    
def next_power_of_2(n):
    """
    Given the number of passengers waiting at a bus stop, determine the minimum bus capacity needed, where bus capacities are designed in powers of 2 (e.g., 32, 64, 128 seats), to ensure all waiting passengers can be accommodated. The transit authority needs this calculation to dispatch a bus with sufficient seating while maintaining operational efficiency.
    

    """
def next_power_of_2(n):
    """
    Given the number of passengers waiting at a bus stop, determine the minimum bus capacity needed, where bus capacities are designed in powers of 2 (e.g., 32, 64, 128 seats), to ensure all waiting passengers can be accommodated. The transit authority needs this calculation to dispatch a bus with sufficient seating while maintaining operational efficiency.
    

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