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

def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
    a1 = (y2 - y1) / (x2 - x1)
    a2 = (y4 - y3) / (x4 - x3)

    return a1 == a2

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = float(data[0])
        y1 = float(data[1])
        x2 = float(data[2])
        y2 = float(data[3])
        x3 = float(data[4])
        y3 = float(data[5])
        x4 = float(data[6])
        y4 = float(data[7])

        if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
            print('YES')
        else:
            print('NO')
            
if __name__ == '__main__':
    main()

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

Python: n = int(input())
ans = []
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    a1 = (ay - by) / (ax - bx)
    a2 = (cy - dy) / (cy - dy)
    if a1 == a2:
        ans.append("YES")
    else:
        ans.append("NO")
print(*ans, sep="\n")

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

Python: a = int(input())

for i in range(0,a):
    g=(map(float,raw_input().split()))
    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]
        if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10:
            print("YES")
        else:
            print("NO")
    except:
        print("NO")

Python: # Parallelism
for _ in range(int(input())):
    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: 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) < 1e-10:
        print("Yes")
    else:
        print("No")

Python: for i in range(int(input())):
  a,b,c,d,e,f,g,h = map(float,input().split())
  if a == c:
    print("YES" if e == g else "NO")
    continue
  if e == g:
    print("NO")
    continue
  print("YES" if (b-d)/(a-c) == (f-h)/(e-g) else "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])
    else:
        r.extend([0])
[print("YES") if i else print("NO") for i in r]

Python: 
n=int(input())

for i in range(n):
    xy=list(map(float,input().split(" ")))
    X1=xy[2]-xy[0]
    Y1=xy[3]-xy[1]
    X2=xy[6]-xy[4]
    Y2=xy[7]-xy[5]
    area=X1*X2-Y1*Y2
    if area==0:
        print("YES")
    else:
        print("NO")

Python: # ????????????????????°??????
import sys

def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
    d1x = x2 - x1
    d1y = y2 - y1
    d2x = x4 - x3
    d2y = y4 - y3

    if d1x != 0.0 and d2x != 0.0:
        #a1 = d1y / d1x
        #a2 = d2y / d2x
        #return a1 == a2
        return d1x * d2y == d1y * d2x

    if d1x == 0.0 and d2x == 0.0:
        return True

    return False

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = float(data[0])
        y1 = float(data[1])
        x2 = float(data[2])
        y2 = float(data[3])
        x3 = float(data[4])
        y3 = float(data[5])
        x4 = float(data[6])
        y4 = float(data[7])

        if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
            print('YES')
        else:
            print('NO')
            
if __name__ == '__main__':
    main()

Python: for i in range(int(input())):
    s = list(map(float,input().split()))
    if (s[0] - s[2]) / (s[1] - s[3]) == (s[4] - s[6]) / (s[5] - s[7]):
        print('YES')
    else:
        print('NO')

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

def gradient(x1, y1, x2, y2):
    if x1 - x2 == 0.0:
        return float('inf')
    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())
    if x1-x2 == 0 or x3-x4 ==0:
        if x1-x2 == 0 and x3-x4 ==0:
            print('YES')
        else:
            print('NO')
    if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4):
        print('YES')
    else:
        print('NO')

Python: from decimal import Decimal as D

n=int(input())

for loop in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=[D(i) for i in input().split(" ")]

    AB=[x2-x1,y2-y1]
    CD=[x4-x3,y4-y3]
    if AB[0]*CD[1]==AB[1]*CD[0]:
        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 (x2-x1)*(y4-y3) - (y2-y1)*(x4-x3) == 0:
        print("YES")
    else:
        print("NO")

Python: N = int(input())
EPS = 1e-6
for i in range(N):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    if x2 == x1 and x4 == x3:
        print('YES')
        continue
    elif x2 == x1 or x4 == x3:
        print('NO')
        continue
    f = abs((y2 - y1) / (x2 - x1))
    g = abs((y4 - y3) / (x4 - x3))
    if g - EPS <= f <= g + EPS:
        print('YES')
    else:
        print('NO')

Python: n = int(input())
ans = []
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    a1 = (ay-by)/(ax-bx)
    a2 = (cy-dy)/(cy-dy)
    if a1 == a2:
        ans.append("YES")
    else:
        ans.append("NO")
print(*ans, sep="\n")

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 _ == 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: n=int(input())

for i in range(n):
    xy=list(map(float,input().split(" ")))
    X1=xy[2]-xy[0]
    Y1=xy[3]-xy[1]
    X2=xy[6]-xy[4]
    Y2=xy[7]-xy[5]
    area=X1*X2-Y1*Y2
    if abs(area)<=1e-10:
        print("YES")
    else:
        print("NO")

Python: p = map( float, raw_input().split() )
flag = ( p[ 1 ] - p[ 0 ] ) * ( p[ 7 ] - p[ 6 ] ) == ( p[ 3 ] - p[ 2 ] ) * ( p[ 5 ] - p[ 4 ] )
print ( flag and 'YES' ) or 'NO'