Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s, h = [], []
p = 0
for _ in range(n):
	s.append(list(map(int, input().split())))

for i in range(len(s)):
	for j in range(i+1, n):
		if s[i][0]*s[j][0] + s[i][1]*s[j][1] == 0: h.append((i, j))

def comb(li):
	count = 0
	if len(li[0]) == 1: return len(li)
	for l in li:
		com = set(list(combinations(l, 2)))
		if len(com & set(h)) == 0:
			count += 1
	return count

for i in range(1, n+1):
	l = list(combinations(range(0, n), i))
	p += comb(l)
print(p % 1000000007)

Fixed submission:
import numpy as np
dic = dict()
mod = 10 ** 9 + 7
p = 0

def reg(a, b):
	if a < 0 or (a == 0 and b < 0):
		a, b = -a, -b
	if b > 0:
		return 0, a, b
	else:
		return 1, -b, a

n = int(input())
for _ in range(n):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		p += 1
		continue
	ab = np.gcd(a, b)
	a, b = a//ab, b//ab
	idx, a, b = reg(a, b)
	k = (a, b)
	if k not in dic.keys():
		dic[k] = [0, 0]
	dic[k][idx] += 1

not_p = 1
for k in dic.keys():
	a, b = k
	pp, pm = dic[k]
	not_p *= (pow(2, pp, mod) + pow(2, pm, mod) - 1) % mod
	not_p %= mod

print((p + not_p -1) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s = []
p = 0
for _ in range(n):
	i, j = map(int, input().split())
	s.append([i, j])

hate = []
for i in range(len(s)):
	for j in range(i+1, n):
		if s[i][0]*s[j][0] + s[i][1]*s[j][1] == 0:
			hate.append([i, j])

def comb(li):
	count = 0
	for l in li:
		if len(l) == 1:
			count += 1
		else:
			flag = 0
			for pr in list(combinations(l, 2)):
				if list(pr) in hate:
					flag = 1
					break
			if flag == 0:
				count += 1
	return count

for i in range(1, n+1):
	l = list(combinations(range(0, n), i))
	p += comb(l)
print(p % 1000000007)

Fixed submission:
import numpy as np
dic = dict()
mod = 10 ** 9 + 7
p = 0

def reg(a, b):
	if a < 0 or (a == 0 and b < 0):
		a, b = -a, -b
	if b > 0:
		return 0, a, b
	else:
		return 1, -b, a

n = int(input())
for _ in range(n):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		p += 1
		continue
	ab = np.gcd(a, b)
	a, b = a//ab, b//ab
	idx, a, b = reg(a, b)
	k = (a, b)
	if k not in dic.keys():
		dic[k] = [0, 0]
	dic[k][idx] += 1

not_p = 1
for k in dic.keys():
	a, b = k
	pp, pm = dic[k]
	not_p *= (pow(2, pp, mod) + pow(2, pm, mod) - 1) % mod
	not_p %= mod

print((p + not_p -1) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s = []
p = 0
for _ in range(n):
	i, j = map(int, input().split())
	s.append([i, j])

hate = []
for i in range(len(s)):
	for j in range(i+1, n):
		if s[i][0]*s[j][0] + s[i][1]*s[j][1] == 0:
			hate.append([i, j])

def comb(li):
	count = 0
	for l in li:
		if len(l) == 1:
			count += 1
		else:
			flag = 0
			for pr in list(combinations(l, 2)):
				if list(pr) in hate: flag = 1
			if flag == 0:
				count += 1
	return count

for i in range(1, n+1):
	l = list(combinations(range(0, n), i))
	p += comb(l)
print(p % 1000000007)

Fixed submission:
import numpy as np
dic = dict()
mod = 10 ** 9 + 7
p = 0

def reg(a, b):
	if a < 0 or (a == 0 and b < 0):
		a, b = -a, -b
	if b > 0:
		return 0, a, b
	else:
		return 1, -b, a

n = int(input())
for _ in range(n):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		p += 1
		continue
	ab = np.gcd(a, b)
	a, b = a//ab, b//ab
	idx, a, b = reg(a, b)
	k = (a, b)
	if k not in dic.keys():
		dic[k] = [0, 0]
	dic[k][idx] += 1

not_p = 1
for k in dic.keys():
	a, b = k
	pp, pm = dic[k]
	not_p *= (pow(2, pp, mod) + pow(2, pm, mod) - 1) % mod
	not_p %= mod

print((p + not_p -1) % mod)