(cls, data: Iterable[List[str]])
return header_rows, data
Return (header rows, rest of data) as discerned from `data`.

        Parameters
        ----------
        data: Iterable
            File content.

        Returns
        -------
        header_rows: List
            Header rows, to be used for constructing domain.
        data: Iterable
            File content without header rows.
Return (header rows, rest of data) as discerned from `data`.
Return ( header rows rest of data ) as discerned from data .
def parse_headers(cls, data: Iterable[List[str]]) -> Tuple[List, Iterable]:
        """
        Return (header rows, rest of data) as discerned from `data`.

        Parameters
        ----------
        data: Iterable
            File content.

        Returns
        -------
        header_rows: List
            Header rows, to be used for constructing domain.
        data: Iterable
            File content without header rows.
        """
        data = iter(data)
        header_rows = []

        # Try to parse a three-line header
        lines = []
        try:
            lines.append(list(next(data)))
            lines.append(list(next(data)))
            lines.append(list(next(data)))
        except StopIteration:
            lines, data = [], chain(lines, data)
        if lines:
            l1, l2, l3 = lines
            # Three-line header if line 2 & 3 match (1st line can be anything)
            if cls.__header_test2(l2) and cls.__header_test3(l3):
                header_rows = [l1, l2, l3]
            else:
                lines, data = [], chain((l1, l2, l3), data)

        # Try to parse a single-line header
        if not header_rows:
            try:
                lines.append(list(next(data)))
            except StopIteration:
                pass
            if lines:
                # Header if none of the values in line 1 parses as a number
                if not all(cls.__is_number(i) for i in lines[0]):
                    header_rows = [lines[0]]
                else:
                    data = chain(lines, data)

        return header_rows, data
def parse_headers ( cls , data : Iterable [ List [ str ] ] ) -> Tuple [ List , Iterable ] : data = iter ( data ) header_rows = [ ] # Try to parse a three-line header lines = [ ] try : lines . append ( list ( next ( data ) ) ) lines . append ( list ( next ( data ) ) ) lines . append ( list ( next ( data ) ) ) except StopIteration : lines , data = [ ] , chain ( lines , data ) if lines : l1 , l2 , l3 = lines # Three-line header if line 2 & 3 match (1st line can be anything) if cls . __header_test2 ( l2 ) and cls . __header_test3 ( l3 ) : header_rows = [ l1 , l2 , l3 ] else : lines , data = [ ] , chain ( ( l1 , l2 , l3 ) , data ) # Try to parse a single-line header if not header_rows : try : lines . append ( list ( next ( data ) ) ) except StopIteration : pass if lines : # Header if none of the values in line 1 parses as a number if not all ( cls . __is_number ( i ) for i in lines [ 0 ] ) : header_rows = [ lines [ 0 ] ] else : data = chain ( lines , data ) return header_rows , data