# Path: wallace/data_type.py
# class DataType(object):
#     VALID_DATA_TYPES = [
#             "integer",
#             "float",
#             "boolean",
#             "date",
#             "string"
#         ]
# 
# 
#     def __init__(self, data_type, categories=None):
#         self.categories = categories
#         if data_type in self.VALID_DATA_TYPES:
#             self.data_type = data_type
#         else:
#             raise ValueError("Data type '%s' is not a valid data type." % data_type)
# 
#     def in_categories(self, data_value):
#         if self.data_type != "string":
#             raise ValueError("Categories are only valid for 'string' data types.")
# 
#         return (data_value in self.categories)
# 
#     def is_equal(self, data_type):
#         return self.data_type == data_type
# 
#     def __str__(self):
#         return self.data_type
# 
#     def __repr__(self):
#         return self.__str__()


from datetime import datetime
from wallace.data_type import DataType
            return lowercased in ["nan", "null", "na", ""]
        else:
            return False

    @classmethod
    def is_date(klass, entry):
        try:
            klass.get_date(entry)
            return True
        except ValueError:
            return False

    @classmethod
    def get_date(klass, entry):
        for date_format in klass.VALID_DATE_FORMATS:
            try:
                return datetime.strptime(entry, date_format)
            except ValueError:
                pass
        raise ValueError("Unable to convert entry into a datetime object.")

    @classmethod
    def classify(klass, entry):
        if klass.is_integer(entry):
            return DataType("integer")
        elif klass.is_float(entry):
            return DataType("float")
        elif klass.is_boolean(entry):
            return DataType("boolean")
        elif klass.is_date(entry):

# Path: wallace/data_type.py
# class DataType(object):
#     VALID_DATA_TYPES = [
#             "integer",
#             "float",
#             "boolean",
#             "date",
#             "string"
#         ]
# 
# 
#     def __init__(self, data_type, categories=None):
#         self.categories = categories
#         if data_type in self.VALID_DATA_TYPES:
#             self.data_type = data_type
#         else:
#             raise ValueError("Data type '%s' is not a valid data type." % data_type)
# 
#     def in_categories(self, data_value):
#         if self.data_type != "string":
#             raise ValueError("Categories are only valid for 'string' data types.")
# 
#         return (data_value in self.categories)
# 
#     def is_equal(self, data_type):
#         return self.data_type == data_type
# 
#     def __str__(self):
#         return self.data_type
# 
#     def __repr__(self):
#         return self.__str__()


# Path: wallace/data_type_classification.py
from datetime import datetime
from wallace.data_type import DataType

            return lowercased in ["nan", "null", "na", ""]
        else:
            return False

    @classmethod
    def is_date(klass, entry):
        try:
            klass.get_date(entry)
            return True
        except ValueError:
            return False

    @classmethod
    def get_date(klass, entry):
        for date_format in klass.VALID_DATE_FORMATS:
            try:
                return datetime.strptime(entry, date_format)
            except ValueError:
                pass
        raise ValueError("Unable to convert entry into a datetime object.")

    @classmethod
    def classify(klass, entry):
        if klass.is_integer(entry):
            return DataType("integer")
        elif klass.is_float(entry):
            return DataType("float")
        elif klass.is_boolean(entry):
            return DataType("boolean")
        elif klass.is_date(entry):

            return DataType("date")