Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()
	for i := 0; i < n; i++ {
		scanner.Scan()
		points := strings.Split(scanner.Text(), " ")
		fpoints := make([]float64, 0)
		for _, v := range points {
			tmp, _ := strconv.ParseFloat(v, 64)
			fpoints = append(fpoints, tmp)
		}
		if fpoints[0] == fpoints[2] && fpoints[4] == fpoints[6] {
			fmt.Println("YES")
			continue
		}
		a := (fpoints[1]-fpoints[3])/(fpoints[0]-fpoints[2])
		b := (fpoints[5]-fpoints[7])/(fpoints[4]-fpoints[6])
		if a == b {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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.00000000001:
        print('NO')
    else:
        print('YES')

Python: # Edit: 2014/11/15
# Lang: Python3
# Time: 00.xxs

# File: pc0021.py


if __name__ == "__main__":

    nset = int(input())

    for i in range(0, nset):

        x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().strip("\n").split(" ")))
        vABx = x2 - x1
        vABy = y2 - y1
        vCDx = x4 - x3
        vCDy = y4 - y3

        #mx = vCDx / vABx
        #my = vCDy / vABy

        #if abs(mx - my) < 1e-10:
        if abs(vABx*vCDy - vCDx*vABy) < 1e-10:
            print("YES")
        else:
            print("NO")
        #print(mx-my)

#

Python: n=int(input())

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

    AB=[x2-x1,y2-y1]
    CD=[x4-x3,y4-y3]
    if abs(AB[0]*CD[1]-AB[1]*CD[0])<10**(-5):
        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')

# 2
# 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0
# 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0

Python: class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __str__(self):
        return "x = {0}, y = {1}".format(self.x, self.y)

class Line(Point):
    eps = 10**(-10)
    def __init__(self, p1, p2):
        self.p1 = p1
        self.p2 = p2

    def isParallel(self, another_p):
        try:
            angle1 = (self.p1.y - self.p2.y) / (self.p1.x - self.p2.x)
            angle2 = (another_p.p1.y - another_p.p2.y) / (another_p.p1.x - another_p.p2.x)
            if angle1 >= angle2-self.eps and angle1 <= angle2+self.eps:
                return True
            else:
                return False
        except ZeroDivisionError:
            if self.p1.x == self.p2.x and another_p.p1.x == another_p.p2.x:
                return True
            else:
                return False


n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    A = Point(x1, y1)
    B = Point(x2, y2)
    C = Point(x3, y3)
    D = Point(x4, y4)

    AB = Line(A, B)
    CD = Line(C, D)

    if AB.isParallel(CD):
        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 and x3 == x4:
        print("YES")
    elif x1 == x2 or x3 == x4:
        print("NO")
    elif (y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < 1e-10:
        print("YES")
    else:
        print("NO")

Python: # ????????????????????°??????
import sys
from decimal import Decimal

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

    return d1x * d2y == d1y * d2x

    # 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])
        x1 = Decimal(data[0])
        y1 = Decimal(data[1])
        x2 = Decimal(data[2])
        y2 = Decimal(data[3])
        x3 = Decimal(data[4])
        y3 = Decimal(data[5])
        x4 = Decimal(data[6])
        y4 = Decimal(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) * 10**5 for j in input().split()]
  if x2 == x1:
    if x4 == x3:
      print("YES")
    else:
      print("NO")
  elif x4 == x3:
    print("NO")
  else:
    print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")