'The header is a series of carriage-return terminated lines of
text that describe the remainder of the file.'

def _is_ply_header(self, fh, subtype):

    valid_header_items = ['comment', 'obj_info', 'element', 'property']
    line = get_next_line(fh)
    if (line != 'ply'):
        return False
    line = get_next_line(fh)
    if (line.find(subtype) < 0):
        return False
    stop_index = 0
    while True:
        line = get_next_line(fh)
        stop_index += 1
        if (line == 'end_header'):
            return True
        items = line.split()
        if (items[0] not in valid_header_items):
            return False
        if (stop_index > MAX_HEADER_LINES):
            break
    return False
