
    Given a patient monitoring system that continuously collects vital sign measurements, write a function that determines the minimum buffer size (in powers of 2) required to store n data points from the patient's health metrics. The buffer size must be optimized to efficiently process and store real-time vital signs while ensuring no data loss occurs during monitoring.
    

    
def next_power_of_2(n):
    """
    Given a patient monitoring system that continuously collects vital sign measurements, write a function that determines the minimum buffer size (in powers of 2) required to store n data points from the patient's health metrics. The buffer size must be optimized to efficiently process and store real-time vital signs while ensuring no data loss occurs during monitoring.
    

    """
def next_power_of_2(n):
    """
    Given a patient monitoring system that continuously collects vital sign measurements, write a function that determines the minimum buffer size (in powers of 2) required to store n data points from the patient's health metrics. The buffer size must be optimized to efficiently process and store real-time vital signs while ensuring no data loss occurs during monitoring.
    

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