Go: package main

import (
        "fmt"
        "math/big"
)

func main() {
        var x1, x2, x3, x4, y1, y2, y3, y4 big.Float
        var n int
        fmt.Scanf("%d", &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)
                var lx, ly, mx, my, mul1, mul2, sub, zz big.Float
                lx.Sub(&x2, &x1)
                ly.Sub(&y2, &y1)
                mx.Sub(&x4, &x3)
                my.Sub(&y4, &y3)
                mul1.Mul(&lx, &my)
                mul2.Mul(&ly, &mx)
                sub.Sub(&mul1, &mul2)
                zz.SetFloat64(0.0)

                if sub.Cmp(&zz) == 0 {
                        fmt.Println("YES")
                } else {
                        fmt.Println("NO")
                }
        }
}

Python: import sys
f = sys.stdin

def take2(iterable):
    i = iter(iterable)
    while True:
        yield next(i) + next(i) * 1j
    

n = int(f.readline())
for _ in range(n):
    xy = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    a, b, c, d = xy
    temp = (a - b) / (c - d)
    if  abs(temp.imag) < 0.001:
        temp = (a - b) / (a - c)
        if abs(temp.imag) < 0.001:
            print('NO')
        else:
            print('YES')
    else:
        print('NO')

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-7

def EQ(a, b):
	return True if abs(a - b) < EPS else False
	
n = int(input())
for i in range(n):
	ax1, ay1, ax2, ay2, bx1, by1, bx2, by2 = list(map(float, input().split()))
	f = False
	if EQ(ax1, ax2) and EQ(bx1, bx2): f = True
	elif EQ((ay2-ay1)*(bx2-bx1), (ax2-ax1)*(by2-by1)): f = True
	print('YES' if f else 'NO')

Python: def cross(x, y):
    return (x.conjugate() * y).imag

def is_parallel(x, y):
    if cross(x, y) < 1e-6:
        return True
    return False

n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    a = complex(x2, y2) - complex(x1, y1)
    b = complex(x4, y4) - complex(x3, y3)    
    if is_parallel(a, b):
        print('YES')
    else:
        print('NO')

Python: import math
n = int(input())

for i in range(n):
  x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())


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

Python: class line():
	def __init__(self):
		self.p={"x":0,"y":0}
		self.q={"x":0,"y":0}

	def setPoint(self,px,py,qx,qy):
		self.p["x"]=px
		self.p["y"]=py
		self.q["x"]=qx
		self.q["y"]=qy
	
	def getVector(self,rev=False):
		if(rev):
			return ((self.p["x"]-self.q["x"]),(self.p["y"]-self.q["y"]))
		else:
			return ((self.q["x"]-self.p["x"]),(self.q["y"]-self.p["y"]))

def main():
	l=line()
	m=line()
	
	for i in range(0,int(input())):
		(lambda x:(l.setPoint(*(x[0:4])),m.setPoint(*(x[4:8]))))(tuple(map(float,input().split(" "))))

		if((l.getVector()==(0,0))or(m.getVector()==(0,0))):
			print("NO")
		elif((lambda l,m:(l[0]/m[0])==(l[1]/m[1]))(l.getVector(),m.getVector())):
			print("YES")
		else:
			print("NO")

if __name__ == '__main__':
	main()

Python: def cross(x, y):
    return (x.conjugate() * y).imag

#x, y: direction vector
def is_parallel(x, y):
    if cross(x, y) < 1e-6:
        return True
    return False

n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    a = complex(x2, y2) - complex(x1, y1)
    b = complex(x4, y4) - complex(x3, y3)    
    if is_parallel(a, b):
        print('YES')
    else:
        print('NO')

Python: n=int(input())
for j in range(n):
    p=[float(i) for i in input().split()]
    if round((p[2]-p[0])*(p[7]-p[5])-(p[3]-p[1])*(p[6]-p[4]),8)==0:
        print("YES")
    else:
        print("NO")

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")

input()

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")
  elif x4 - x3 == 0.0:
    print("NO")
  else:
    print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")

Python: count = int(input())
for i in range(count):
    x = list(map(float ,input().split()))
    x1=x[2]-x[0]
    y1=x[3]-x[1]
    x2=x[6]-x[4]
    y2=x[7]-x[5]
    if x1==0:
        if x2==0:
            print("YES")
        else:
            print("NO")
    elif y1==0:
        if y2==0:
            print("YES")
        else:
            print("NO")
    else:
        if y1/x1==y2/x2:
            print("YES")
        else:
            print("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 _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if (x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1) == 0:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
    Date = list(map(float,input().split()))
    if Date[2] != Date[0] or Date[6] != Date[4]:
        if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]):
            print("YES")
            continue
        else:
            print("NO")
            continue
    elif Date[2] != Date[0] and Date[6] != Date[4]:
        print("YES")

Python: n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    if ((y1-y2)/(x1-x2))==((y4-y3)/(x4-x3)) or (y1-y2)/(x1-x2)==((y3-y4)/(x3-x4)):
        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())
    if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4):
        print('YES')
    else:
        print('NO')

Python: import sys
f = sys.stdin


def take2(iterable):
    i = iter(iterable)
    while True:
        yield next(i) + next(i) * 1j
def cross(ab, cd):
    return ab.real * cd.imag - ab.imag * cd.real

n = int(f.readline())
for _ in range(n):
    a, b, c, d = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    print('YES' if abs(cross(a - b, c - d)) < 1e-10 else 'NO')

Python: 
import mth

num = int(input())

for i in range(num):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(' '))
    aaa = (y1 - y2) * (x3 - x4)
    bbb = (y3 - y4) * (x1 - x2)
    if abs(aaa - bbb) <= 0:
        print('YES')
    else:
        print('NO')

Python: import sys

# args = sys.argv

args = [int(float(a)) for line in sys.stdin]


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 int(tmp3) == 0:
      print("YES")
    else:
      print("NO")

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

Python: n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print('YES' if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4) else 'NO')