'Given a value, infer the correct data type'

def _bind_value(self, value):

    self.data_type = 'n'
    if ((value is True) or (value is False)):
        self.data_type = self.TYPE_BOOL
    elif isinstance(value, NUMERIC_TYPES):
        pass
    elif isinstance(value, NUMERIC_TYPES):
        self.data_type = self.TYPE_NUMERIC
    elif isinstance(value, TIME_TYPES):
        self.data_type = self.TYPE_NUMERIC
        value = self._cast_datetime(value)
    elif isinstance(value, STRING_TYPES):
        value = self.check_string(value)
        self.data_type = self.TYPE_STRING
        if ((len(value) > 1) and value.startswith('=')):
            self.data_type = self.TYPE_FORMULA
        elif (value in self.ERROR_CODES):
            self.data_type = self.TYPE_ERROR
        elif self.guess_types:
            value = self._infer_value(value)
    elif (value is not None):
        raise ValueError('Cannot    convert    {0}    to    Excel'.format(value))
    self._value = value
