Read the sheet, get value the header, get number columns and rows
        :return:
437030
def _open_sheet(self):
        
        if self.sheet_name and not self.header:
            self._sheet = self._file.worksheet(self.sheet_name.title)
            self.ncols = self._sheet.col_count
            self.nrows = self._sheet.row_count
            for i in range(1, self.ncols+1):
                self.header = self.header + [self._sheet.cell(1, i).value]
1158389
def get_cell(self, index, column):
        
        i = sorted_index(self._index, index) if self._sort else self._index.index(index)
        c = self._columns.index(column)
        return self._data[c][i]
391406
def dict_row_reader(self):
        

        rows = self.unpacked_contents

        if not rows:
            return

        header = rows.pop(0)

        for row in rows:
            yield dict(list(zip(header, row)))
1064479
def getCumPos(data):
    
    pos = getPosNew(data)
    chrom= data.geno['col_header']['chrom'][:]
    n_chroms = int(chrom.max())
    x = 0
    for chrom_i in range(1,n_chroms+1):
        I = chrom==chrom_i
        pos[I]+=x
        x=pos[I].max()
    return pos
523249
def headerData(self, section, orientation, role):
        """"""
        if role == Qt.TextAlignmentRole:
            if orientation == Qt.Horizontal:
                return Qt.AlignCenter | Qt.AlignBottom
            else:
                return Qt.AlignRight | Qt.AlignVCenter
        if role != Qt.DisplayRole and role != Qt.ToolTipRole:
            return None
        if self.axis == 1 and self._shape[1] <= 1:
            return None
        orient_axis = 0 if orientation == Qt.Horizontal else 1
        if self.model.header_shape[orient_axis] > 1:
            header = section
        else:
            header = self.model.header(self.axis, section)

            # Don't perform any conversion on strings
            # because it leads to differences between
            # the data present in the dataframe and
            # what is shown by Spyder
            if not is_type_text_string(header):
                header = to_text_string(header)

        return header
291687
def process_row(self):
        
        self.log_response_message("got ROW message")
        r = self._reader
        info = self.res_info
        info.row_count += 1
        for i, curcol in enumerate(info.columns):
            curcol.value = self.row[i] = curcol.serializer.read(r)
1093531
def read_data(self, sheet, begin=None):
        
        line = self.begin
        rows = sheet.rows
        for i in range(line-1):
            rows.next()
        template_line = self.template[self.begin-1]
        if not template_line['subs']:
            raise ValueError("Template definition is not right")

        for row in rows:
            d = {}
            for c in template_line['subs'][0]['cols']:
                if c['field']:
                    cell = row[c['col']-1]
                    if isinstance(cell.value, (str, unicode)):
                        v = cell.value.strip()
                    else:
                        v = cell.value
                    d[c['field']] = v
            yield d
583304
def get_text(self):
        '''
            
        '''
        row_lines = []
        for line in zip_longest(*[column.get_cell_lines() for column in self.columns], fillvalue=' '):
            row_lines.append('  '.join(line))
        return '\n'.join(row_lines)
193001
def getWorksheet(self):
        
        ws = None
        if self._current_ws_index < len(self._worksheets):
            ws = self._ws_data(self._worksheets[self._current_ws_index])
        return ws
691004
def headers(self, serialize_cell=None):
    """"""
    if serialize_cell is None:
      serialize_cell = self.get_cell_value
    return [serialize_cell(cell) for cell in self.rows[0]]
857420
def _get_column_cell_val(self, obj, column):
        
        name = column['name']
        return self._get_formatted_val(obj, name, column)
1144790
def get_chron_data(temp_sheet, row, total_vars):
    
    data_row = []
    missing_val_list = ['none', 'na', '', '-']
    for i in range(0, total_vars):
        cell = temp_sheet.cell_value(row, i)
        if isinstance(cell, str):
            cell = cell.lower()
        if cell in missing_val_list:
            cell = 'nan'
        data_row.append(cell)
    return data_row
692713
def read_excel(
    filename: PathLike,
    sheet: Union[str, int],
    dtype: str='float32',
) -> AnnData:
    
    # rely on pandas for reading an excel file
    from pandas import read_excel
    df = read_excel(fspath(filename), sheet)
    X = df.values[:, 1:]
    row = {'row_names': df.iloc[:, 0].values.astype(str)}
    col = {'col_names': np.array(df.columns[1:], dtype=str)}
    return AnnData(X, row, col, dtype=dtype)
919142
def read_header(self):
        """"""
        format = '!HHHHHH'
        length = struct.calcsize(format)
        info = struct.unpack(format,
                self.data[self.offset:self.offset + length])
        self.offset += length

        self.id = info[0]
        self.flags = info[1]
        self.num_questions = info[2]
        self.num_answers = info[3]
        self.num_authorities = info[4]
        self.num_additionals = info[5]
495595
def headers(self):
        
        if self._headers is None:
            query = CellQuery()
            query.max_row = '1'
            feed = self._service.GetCellsFeed(self._ss.id, self.id,
                                              query=query)
            self._headers = feed.entry
        return [normalize_header(h.cell.text) for h in self._headers]
712567
def columns(self):
        
        return Index(np.array(self._gather_column_names(), dtype=np.bytes_), np.dtype(np.bytes_))
557010
def strings(self):
        

        sheet = self.result.add_sheet("strings")
        self.header(sheet, "strings")

        n_row = 1  # row number

        for entry in self.po:
            row = sheet.row(n_row)
            row.write(0, entry.msgid)
            row.write(1, entry.msgstr)
            n_row += 1
            sheet.flush_row_data()