Go: package main

import "fmt"

func abs(x float64) float64 {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	var n int
	var x1, y1, x2, y2, x3, y3, x4, y4 float64
	fmt.Scan(&n)
	for i := 0 ; i < n; i++ {
		fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)
		if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Python: import sys

args = sys.argv

class Point():
  def __init__(self,x,y):
      self.x = x
      self.y = y

  def __sub__(self,oth):
    self.x = self.x - oth.x
    self.y = self.y - oth.y
    return Point(self.x,self.y)

  def __str__(self):
    return "%s(%r)" %(self.__class__,self.__dict__)

# input = [6, 6, 6, 15, 15, 15,20,3]


# A,B,C,D = (Point(input[i],input[i+1]) for i in range(0,len(input),2))
# tmp = B - A
# tmp2 = C - D
# tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)


for _ in range(args[0]):
  if not _ == 0:
    A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
    tmp = B - A
    tmp2 = C - D
    tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
  if tmp3 == 0:
    yield "YES"
  else:
    yield "NO"

Python: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    print(info)

Python: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    ab = [x2 - x1, y2 - y1]
    cd = [x4 - x3, y4 - y3]
    if abs(ab[0] * cd[1] - ab[1] * cd[0]) > 0.000001:
        print('NO')
    else:
        print('YES')

Python: from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from sys import stdin

def gradient(x1, y1, x2, y2):
    return (y1 - y2) / (x1 - x2)

for n in xrange(int(stdin.readline())):
    p = [float(s) for s in stdin.readline().split()]
    if gradient(*p[:4]) == gradient(*p[4:]):
        print('YES')
    else:
        print('NO')

Python: n = int(input())
for i in range(n):
  x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
  v1x = x1 - x2
  v1y = y1 - y2
  v2x = x3 - x4
  v2y = y3 - y4
  if abs(v1x * v2y - v2x * v1y) < 10 ** -10 :
    print("YES")
  else:
    print("NO")

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    
    if (c-a)*(h-f) - (d-b)*(g-e):
        print("No")
    else:
        print("Yes")

Python: for _ in[0]*int(input()):
 a,b,c,d,e,f,g,h=map(float,input().split())
 print(['NO','YES'][abs((a-c)*(f-h)-(e-g)*(b-d))<1e-6])

Python: import sys

args = sys.argv

print(args)


class Point():
  def __init__(self,x,y):
      self.x = x
      self.y = y

  def __sub__(self,oth):
    self.x = self.x - oth.x
    self.y = self.y - oth.y
    return Point(self.x,self.y)

  def __str__(self):
    return "%s(%r)" %(self.__class__,self.__dict__)

for _ in range(args[0]):
  if _ == 0:
    pass
  else:
    A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
    tmp = B - A
    tmp2 = C - D
    tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
    if tmp3 == 0:
      print("YES")
    else:
      print("NO")

Python: def calc(a):
    i1 = (a[3] - a[1]) / (a[2] - a[0])
    i2 = (a[7] - a[5]) / (a[6] - a[4])
    if i1 == i2:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    N = int(input())
    a = []
    for i in range(0, N):
        a.append(list(map(float, input().split())))
        calc(a[i])

Python: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print(["NO","YES"][abs((x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2)) < 1e-10])

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    
    if abs((c-a)*(h-f) - (d-b)*(g-e)) < 1e-10:
        print("No")
    else:
        print("Yes")

Python: n = int(input())
for i in range(n):
  x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()]
  if x2 - x1 == 0.0:
    if x4 - x3 == 0.0:
      print("YES")
    else:
      print("NO")
  print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
#    if (b-d)/(a-c) == (f-h)/(e-g):
    print("Yes")
#    else:
    print("No")

Python: n = int(input())
for line in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    d = (x2 - x1)*(y4 - y3) - (y2 - y1)*(x4 - x3)
    if -10**-11 <d < 10**-11:
        print('YES')
    else:
        print('NO')

Python: for _ in[0]*int(input()):
 a,b,c,d,e,f,g,h=map(float,input().split())
 print(['NO','YES'][abs((a-c)*(f-h)-(e-g)*(b-d))<1e-9])

Python: import math
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4):
    if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) == 0:
        print("YES")
    else:
        print("NO")
a = int(input())
f=[]
for i in range(a):
    f.append(map(float,raw_input().split()))
for g in f:
    try:
        x1=g[0]
        y1=g[1]
        x2=g[2]
        y2=g[3]
        x3=g[4]
        y3=g[5]
        x4=g[6]
        y4=g[7]
        naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
    except:
        print("NO")

Python: import math


def equal(x, y):
    return math.fabs(x - y) <= 10 ** (-8)


for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split()))
    d1 = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
    aco = (x1 - x2) / d1
    asi = (y1 - y2) / d1

    d2 = math.sqrt((x3 - x4) ** 2 + (y3 - y4) ** 2)
    bco = (x3 - x4) / d2
    bsi = (y3 - y4) / d2

    if equal(aco,bco) and  equal(bco,bsi):
        print('YES')
    else:
        print('NO')

Python: n = int(input())
for _ in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = [float(x) for x in input().split()]

    a = [x2-x1, y2-y1]
    b = [x4-x3, y4-y3]

    if a[0]*b[1] == a[1]*b[0]:
        print('YES')
    else:
        print('NO')

Python: import math
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
        '''
        if abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.000001:
            print("YES")
        else:
            print("NO")

Python: # coding=utf-8

n = int(input())
for i in range(n):
    points_list = list(map(float, input().split()))
    abx = points_list[2] - points_list[0]
    aby = points_list[3] - points_list[1]
    cdx = points_list[6] - points_list[4]
    cdy = points_list[7] - points_list[5]

    if abx == cdx and aby == cdy:
        print('YES')
    else:
        print('NO')

Python: n = int(input())
cordinates = [list(map(float, input().split())) for _ in range(n)]

for cod in cordinates:
    x1, y1, x2, y2, x3, y3, x4, y4 = cod
    if abs((x2-x1) * (y4-y3) - (y2-y1) * (x4-x3)) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: from fractions import Fraction

def sroap(x1,y1,x2,y2):
	if x2 - x1 == 0:
		return float("inf")
	else:
		return Fraction(y2 - y1,x2 - x1)
		
N = int(input())
for n in range(N):
	Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 5),(map(float,input().split())))
	if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy):
		print("YES")
	else:
		print("NO")

Python: n = int(input())
for line in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    d = (x2 - x1)*(y4 - y3) - (y2 - y1)*(x4 - x3)
    if -10**-6 <d < 10**-6:
        print('YES')
    else:
        print('NO')

Python: r=[]
for i in range(int(input())):
    d=[float(i) for i in input().split()]
    if d[0]-d[2] != 0 and d[4]-d[6] != 0:
        a=(d[1]-d[3])/(d[0]-d[2])
        b=(d[5]-d[7])/(d[4]-d[6])
        if a==b:r.extend([1])
        else:r.extend([0])
    elif (d[0]==d[2] and d[4]==d[6]):
        r.extend([1])
    else:
        r.extend([0])
[print("YES") if i else print("NO") for i in r]