(cls, data: Iterable, header: _TableHeader)
return array, rowlen
Determine maximum row length.
        Return data as an array, with width dependent on header size.
        Append `names`, `types` and `flags` if shorter than row length.

        Parameters
        ----------
        data: Iterable
            File content without header rows.
        header: _TableHeader
            Header lists converted into _TableHeader.

        Returns
        -------
        data: np.ndarray
            File content without header rows.
        rowlen: int
            Number of columns in data.
Determine maximum row length.
        Return data as an array, with width dependent on header size.
        Append `names`, `types` and `flags` if shorter than row length.
Determine maximum row length . Return data as an array with width dependent on header size . Append names types and flags if shorter than row length .
def adjust_data_width(cls, data: Iterable, header: _TableHeader) -> \
            Tuple[np.ndarray, int]:
        """
        Determine maximum row length.
        Return data as an array, with width dependent on header size.
        Append `names`, `types` and `flags` if shorter than row length.

        Parameters
        ----------
        data: Iterable
            File content without header rows.
        header: _TableHeader
            Header lists converted into _TableHeader.

        Returns
        -------
        data: np.ndarray
            File content without header rows.
        rowlen: int
            Number of columns in data.
        """

        def equal_len(lst):
            nonlocal strip
            if len(lst) > rowlen > 0:
                lst = lst[:rowlen]
                strip = True
            elif len(lst) < rowlen:
                lst.extend([''] * (rowlen - len(lst)))
            return lst

        rowlen = max(map(len, (header.names, header.types, header.flags)))
        strip = False

        # Ensure all data is of equal width in a column-contiguous array
        data = [equal_len([s.strip() for s in row])
                for row in data if any(row)]
        array = np.array(data, dtype=object, order='F')

        if strip:
            warnings.warn("Columns with no headers were removed.")

        # Data may actually be longer than headers were
        try:
            rowlen = array.shape[1]
        except IndexError:
            pass
        else:
            for lst in (header.names, header.types, header.flags):
                equal_len(lst)
        return array, rowlen
def adjust_data_width ( cls , data : Iterable , header : _TableHeader ) -> Tuple [ np . ndarray , int ] : def equal_len ( lst ) : nonlocal strip if len ( lst ) > rowlen > 0 : lst = lst [ : rowlen ] strip = True elif len ( lst ) < rowlen : lst . extend ( [ '' ] * ( rowlen - len ( lst ) ) ) return lst rowlen = max ( map ( len , ( header . names , header . types , header . flags ) ) ) strip = False # Ensure all data is of equal width in a column-contiguous array data = [ equal_len ( [ s . strip ( ) for s in row ] ) for row in data if any ( row ) ] array = np . array ( data , dtype = object , order = 'F' ) if strip : warnings . warn ( "Columns with no headers were removed." ) # Data may actually be longer than headers were try : rowlen = array . shape [ 1 ] except IndexError : pass else : for lst in ( header . names , header . types , header . flags ) : equal_len ( lst ) return array , rowlen