def parse_cell(self, cell, coords, cell_mode=CellMode.cooked):
    """Parses a cell according to the cell.ctype."""
    # pylint: disable=too-many-return-statements
    if cell_mode == CellMode.cooked:
      if cell.ctype == xlrd.XL_CELL_BLANK:
        return None

      if cell.ctype == xlrd.XL_CELL_BOOLEAN:
        return cell.value

      if cell.ctype == xlrd.XL_CELL_DATE:
        if self.handle_ambiguous_date:
          try:
            return self._parse_date(cell.value)
          except xlrd.xldate.XLDateAmbiguous:
            return self.handle_ambiguous_date(cell.value)
        else:
          return self._parse_date(cell.value)

      if cell.ctype == xlrd.XL_CELL_EMPTY:
        return None

      if cell.ctype == xlrd.XL_CELL_ERROR:
        return cell.value

      if cell.ctype == xlrd.XL_CELL_NUMBER:
        return cell.value

      if cell.ctype == xlrd.XL_CELL_TEXT:
        return cell.value

      raise ValueError("Unhandled cell type {0}".format(cell.ctype))
    else:
      return cell
def parse_cell ( self , cell , coords , cell_mode = CellMode . cooked ) : if cell_mode == CellMode . cooked : if cell . ctype == xlrd . XL_CELL_BLANK : return None if cell . ctype == xlrd . XL_CELL_BOOLEAN : return cell . value if cell . ctype == xlrd . XL_CELL_DATE : if self . handle_ambiguous_date : try : return self . _parse_date ( cell . value ) except xlrd . xldate . XLDateAmbiguous : return self . handle_ambiguous_date ( cell . value ) else : return self . _parse_date ( cell . value ) if cell . ctype == xlrd . XL_CELL_EMPTY : return None if cell . ctype == xlrd . XL_CELL_ERROR : return cell . value if cell . ctype == xlrd . XL_CELL_NUMBER : return cell . value if cell . ctype == xlrd . XL_CELL_TEXT : return cell . value raise ValueError ( "Unhandled cell type {0}" . format ( cell . ctype ) ) else : return cell
Parses a cell according to the cell.ctype.