Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
B = []
C = {}
m = 1000000007

def mypow(dummy, num):

    ans = 1
    for i in range(num):
        ans = (ans*2)%1000000007
    return ans

for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
    if a/b in C.keys():
        C[a/b] +=1
    else: C[a/b] = 1
    
used = set()
ans = 1
for c in C.keys():
    if c in used: continue
    if -1/c in C.keys():
        used.add(-1/c)
        
        score = mypow(2, C[c]) + mypow(2, C[-1/c])- 1
        
        ans = (ans * score)%m

    else:
        
        ans = (ans*mypow(2, C[c]))%m

print(ans-1)






Fixed submission:
import math
N = int(input())
A = 0
B = 0
Z = 0
C = {}
m = 1000000007

def mypow(dummy, num):
    ans = 1
    for i in range(num):
        ans = (ans*2)%1000000007
    return ans

def rNum(a, b):
    g = math.gcd(a, b)
    if a <0 and b<0:
        a *= -1
        b *= -1
    if a >0 and b <0:
        return (-1*(a//g), -1*(b//g))
    else:
        return (a//g, b//g)


for i in range(N):
    a, b = map(int, input().split())
    
    if a == 0 and b==0:
        Z += 1
        continue
    elif a==0:
        A += 1
        continue
    elif b==0:
        B +=1
        continue
    
    r = rNum(a, b)
    if r in C.keys():
        C[r] +=1
    else: C[r] = 1


used = set()
ans = 1
ans *= (mypow(2, A) + mypow(2, B) -1)%m


for c in C.keys():
    if c in used: continue
    a, b = c
    r = rNum(b, -1*a)
    if r in C.keys():
        if c == r: continue
        used.add(r)
        score = (mypow(2, C[c]) + mypow(2, C[r])- 1)
        ans *= score

    else:
        ans *= mypow(2, C[c])

ans += Z

print((ans-1)%m)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
B = []
C = {}
m = 1000000007
for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
    if a/b in C.keys():
        C[a/b] +=1
    else: C[a/b] = 1
    
used = set()
ans = 1
for c in C.keys():
    if c in used: continue
    if -1/c in C.keys():
        used.add(-1/c)
        score = pow(2, C[c]) + pow(2, C[-1/c])- 1
        
        ans = (ans * score)%m

    else:
        
        ans = (ans*pow(2, C[c]))%m

print(ans-1)






Fixed submission:
import math
N = int(input())
A = 0
B = 0
Z = 0
C = {}
m = 1000000007

def mypow(dummy, num):
    ans = 1
    for i in range(num):
        ans = (ans*2)%1000000007
    return ans

def rNum(a, b):
    g = math.gcd(a, b)
    if a <0 and b<0:
        a *= -1
        b *= -1
    if a >0 and b <0:
        return (-1*(a//g), -1*(b//g))
    else:
        return (a//g, b//g)


for i in range(N):
    a, b = map(int, input().split())
    
    if a == 0 and b==0:
        Z += 1
        continue
    elif a==0:
        A += 1
        continue
    elif b==0:
        B +=1
        continue
    
    r = rNum(a, b)
    if r in C.keys():
        C[r] +=1
    else: C[r] = 1


used = set()
ans = 1
ans *= (mypow(2, A) + mypow(2, B) -1)%m


for c in C.keys():
    if c in used: continue
    a, b = c
    r = rNum(b, -1*a)
    if r in C.keys():
        if c == r: continue
        used.add(r)
        score = (mypow(2, C[c]) + mypow(2, C[r])- 1)
        ans *= score

    else:
        ans *= mypow(2, C[c])

ans += Z

print((ans-1)%m)