def section_tortuosity(section):
pts = section.points<EOL>return <NUM_LIT:1> if len(pts) < <NUM_LIT:2> else mm.section_length(pts) / mm.point_dist(pts[-<NUM_LIT:1>], pts[<NUM_LIT:0>])<EOL>
Tortuosity of a section

    The tortuosity is defined as the ratio of the path length of a section
    and the euclidian distnce between its end points.

    The path length is the sum of distances between consecutive points.

    If the section contains less than 2 points, the value 1 is returned.