
    Write a function that determines the minimum batch size for processing transit vehicle sensor data, where the batch size must be a power of 2 and able to accommodate all sensor readings collected during a maintenance cycle. Given the number of sensor readings n, find the smallest power of 2 that can hold all the data points without splitting any maintenance cycle's readings across multiple batches.
    

    
def next_power_of_2(n):
    """
    Write a function that determines the minimum batch size for processing transit vehicle sensor data, where the batch size must be a power of 2 and able to accommodate all sensor readings collected during a maintenance cycle. Given the number of sensor readings n, find the smallest power of 2 that can hold all the data points without splitting any maintenance cycle's readings across multiple batches.
    

    """
def next_power_of_2(n):
    """
    Write a function that determines the minimum batch size for processing transit vehicle sensor data, where the batch size must be a power of 2 and able to accommodate all sensor readings collected during a maintenance cycle. Given the number of sensor readings n, find the smallest power of 2 that can hold all the data points without splitting any maintenance cycle's readings across multiple batches.
    

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