#NEWLINE# def interleave( * args ) : #NEWLINE# #INDENT# 'Interleaves the elements of the provided arrays.\n\n        >>> a = [(0, 0), (1, 0), (2, 0), (3, 0)]\n        >>> b = [(0, 0), (0, 1), (0, 2), (0, 3)]\n        >>> interleave(a, b)\n        [(0, 0, 0, 0), (1, 0, 0, 1), (2, 0, 0, 2), (3, 0, 0, 3)]\n\n    This is useful for combining multiple vertex attributes into a single\n    vertex buffer. The shader attributes can be assigned a slice of the\n    vertex buffer.\n    ' #NEWLINE# result = [ ] #NEWLINE# for array in zip ( * args ) : #NEWLINE# #INDENT# result . append ( tuple ( flatten ( result ) ) ) #NEWLINE# #UNINDENT# return result