Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _parse_header(stream):
'''
Parse a PLY header from a readable file-like stream.
'''
parser = _PlyHeaderParser()
while parser.consume(stream.readline()):
pass
return PlyData(
[PlyElement(*e) for e in parser.elements],
parser.format == 'ascii',
_byte_order_map[parser.format],
parser.comments,
parser.obj_info
)