def __init__(self, worksheet, title=None):
        width = 0
        self.title = title
        self.worksheet = worksheet
        try:
            header_row = self.worksheet.iter_rows().next()
        except __HOLE__:
            header_row = []
        for cell in header_row:
            if cell.value is None:
                break
            else:
                width += 1
        self.worksheet.calculate_dimension(force=True)

        def iterator():
            def _convert_float(value):
                """
                excel doesn't distinguish between 1 and 1.0
                if it can be an integer assume it is
                """
                if isinstance(value, float) and int(value) == value:
                    return int(value)
                else:
                    return value or ''
            for row in self.worksheet.iter_rows():
                cell_values = [
                    _convert_float(cell.value)
                    for cell in row[:width]
                ]
                if not any(cell_values):
                    break
                yield cell_values
        super(WorksheetJSONReader, self).__init__(iterator())
dataset/ETHPy150Open dimagi/commcare-hq/corehq/util/spreadsheets/excel.py/WorksheetJSONReader.__init__