
    Design a function that determines the minimum batch size (as a power of 2) needed to process credit card transactions for fraud pattern analysis, where the batch size must be large enough to accommodate all incoming transactions while maintaining optimal processing efficiency. Given the current number of pending transactions, the function should return the smallest power of 2 that can handle the entire transaction set for fraud detection analysis.
    

    
def next_power_of_2(n):
    """
    Design a function that determines the minimum batch size (as a power of 2) needed to process credit card transactions for fraud pattern analysis, where the batch size must be large enough to accommodate all incoming transactions while maintaining optimal processing efficiency. Given the current number of pending transactions, the function should return the smallest power of 2 that can handle the entire transaction set for fraud detection analysis.
    

    """
def next_power_of_2(n):
    """
    Design a function that determines the minimum batch size (as a power of 2) needed to process credit card transactions for fraud pattern analysis, where the batch size must be large enough to accommodate all incoming transactions while maintaining optimal processing efficiency. Given the current number of pending transactions, the function should return the smallest power of 2 that can handle the entire transaction set for fraud detection analysis.
    

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