def orthants(V):
return [[i for i in range(len(V)) if V[i][0]*x >= 0 and V[i][1]*y >= 0 and V[i][2]*z >= 0] for x in [-1,1] for y in [-1,1] for z in [-1,1]]
def wide(V):
def isbase(i,j):
for k in [0,1,2]:
if V[i][k] in [1,-1]:
if V[j][k] != 0:
return False
elif V[i][k] == 0:
if V[j][k] not in [2,-2]:
return False
else:
if V[i][k]*V[j][k] < 0:
return False
return True
return [[i]+[j for j in range(len(V)) if isbase(i,j)] for i in range(len(V))]