Buggy python submission (verdict: Runtime Error):
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
for i in range(ceil(log2(max(a)))):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)


Fixed submission:
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
if max(a) == 0:
    x = 1
else:
    x = ceil(log2(max(a)))

for i in range(x):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = [int(i) for i in input().split()]
s = 0
c = 1
for i in range(int(math.log2(max(A))+1)):
    #print(max(A))
    s0 = 0
    s1 = 0
    for i,j in enumerate(A):
        A[i],mod = divmod(j,2)
        if mod==1:
            s1 +=1
        else:
            s0 +=1
    s = (s+(s0*s1*c)%(10**9+7))%(10**9+7)
    c *= 2
print(s)

Fixed submission:
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
if max(a) == 0:
    x = 1
else:
    x = ceil(log2(max(a)))

for i in range(x):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
s = 0
c = 1
while max(A) != 0:
    #print(max(A))
    s0 = 0
    s1 = 0
    for i,j in enumerate(A):
        A[i],mod = divmod(j,2)
        if mod==1:
            s1 +=1
        else:
            s0 +=1
    s = (s+(s0*s1*c)%(10**9+7))%(10**9+7)
    c *= 2
print(s)

Fixed submission:
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
if max(a) == 0:
    x = 1
else:
    x = ceil(log2(max(a)))

for i in range(x):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
s = 0
c = 1
while max(A) != 0:
    #print(max(A))
    s0 = 0
    s1 = 0
    for i,j in enumerate(A):
        if True:
            A[i],mod = divmod(j,2)
            #print(mod)
            if mod==1:
                s1 +=1
            else:
                s0 +=1
        #print(s0,s1)
    s = (s+(s0*s1*c))%(10**9+7)
    c *= 2
print(s)

Fixed submission:
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
if max(a) == 0:
    x = 1
else:
    x = ceil(log2(max(a)))

for i in range(x):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    for j in range(i+1,N):
        c = 1
        q1,mod1 = divmod(A[i],2)
        q2,mod2 = divmod(A[j],2)
        g = 1
        while g != 0:
            if mod1 ^ mod2:
                #print(A[i],A[j])
                #print("a")
                s += c
                s = s%(10**9+7)
            g = max(q1,q2)
            q1,mod1 = divmod(q1,2)
            q2,mod2 = divmod(q2,2)
            c*=2

print(s)

Fixed submission:
import numpy as np
from math import ceil,log2
N = int(input())
a = np.array(list(map(int,input().split())),dtype=np.int64)
ans = 0
count = 1
if max(a) == 0:
    x = 1
else:
    x = ceil(log2(max(a)))

for i in range(x):
    b = a%2
    s = np.count_nonzero(b==1)*np.count_nonzero(b==0)*count
    ans +=s
    count *= 2
    a = a//2
    ans %= 10**9+7
print(ans)