def fitLine(pts):
    n = len(pts)
    if n < 1:
        return (0,0),(0,0)
    a = np.zeros((n-1,2))
    for i in range(n-1):
        v = pts[i] - pts[i+1]
        a[i] = v / np.linalg.norm(v)
    direction = np.mean(a[1:-1], axis=0)
    start = np.mean(pts[1:-1], axis=0)
    return start, start+direction
return if I have any nans; enables various perf speedups
dataset/ETHPy150Open google/roboto/scripts/lib/fontbuild/alignpoints.py/fitLine--crossover with--dataset/ETHPy150Open pydata/pandas/pandas/core/base.py/IndexOpsMixin.hasnans