def segments_to_numpy(segments):
segments = numpy.array(segments, dtype=SEGMENT_DATATYPE, ndmin=<NUM_LIT:2>)  <EOL>segments = segments if SEGMENTS_DIRECTION == <NUM_LIT:0> else numpy.transpose(segments)<EOL>return segments<EOL>
given a list of 4-element tuples, transforms it into a numpy array