# Path: typepy/_common.py
# def strip_ansi_escape(value: Any) -> str:
#     return ansi_escape.sub("", value)
# 
# Path: typepy/_const.py
# class DefaultValue:
#     FLOAT_TYPE = Decimal
#     STRIP_ANSI_ESCAPE = True
# 
# class ParamKey:
#     STRIP_ANSI_ESCAPE = "strip_ansi_escape"
#     TIMEZONE = "timezone"
# 
# Path: typepy/error.py
# class TypeConversionError(TypeError):
#     """
#     Exception raised when failed to convert data.
#     """
# 
# Path: typepy/converter/_interface.py
# class AbstractValueConverter(ValueConverterInterface):
#     __slots__ = "_value"
# 
#     def __init__(self, value, params):
#         self._value = value
#         self._params = params
# 
#     def __repr__(self):
#         try:
#             string = str(self.force_convert())
#         except TypeConversionError:
#             string = "[ValueConverter ERROR] failed to force_convert"
# 
#         return string


from datetime import date, datetime
from .._common import strip_ansi_escape
from .._const import DefaultValue, ParamKey
from ..error import TypeConversionError
from ._interface import AbstractValueConverter
        from ..type._integer import Integer
        from ..type._realnumber import RealNumber
        from packaging.version import InvalidVersion, Version
        import dateutil.parser
        import pytz

    def force_convert(self):
        self.__datetime = self.__from_datetime()
        if self.__datetime:
            return self.__datetime

        self.__datetime = self.__from_timestamp()
        if self.__datetime:
            return self.__datetime

        return self.__from_datetime_string()

    def __from_datetime(self):
        if not isinstance(self._value, (date, datetime)):
            return None

        if isinstance(self._value, datetime):
            self.__datetime = self._value
        elif isinstance(self._value, date):
            self.__datetime = datetime(
                year=self._value.year, month=self._value.month, day=self._value.day
            )

        if self.__timezone:
            self.__datetime = self.__timezone.localize(self.__datetime)

        return self.__datetime

    def __from_timestamp(self):


# Path: typepy/_common.py
# def strip_ansi_escape(value: Any) -> str:
#     return ansi_escape.sub("", value)
# 
# Path: typepy/_const.py
# class DefaultValue:
#     FLOAT_TYPE = Decimal
#     STRIP_ANSI_ESCAPE = True
# 
# class ParamKey:
#     STRIP_ANSI_ESCAPE = "strip_ansi_escape"
#     TIMEZONE = "timezone"
# 
# Path: typepy/error.py
# class TypeConversionError(TypeError):
#     """
#     Exception raised when failed to convert data.
#     """
# 
# Path: typepy/converter/_interface.py
# class AbstractValueConverter(ValueConverterInterface):
#     __slots__ = "_value"
# 
#     def __init__(self, value, params):
#         self._value = value
#         self._params = params
# 
#     def __repr__(self):
#         try:
#             string = str(self.force_convert())
#         except TypeConversionError:
#             string = "[ValueConverter ERROR] failed to force_convert"
# 
#         return string


# Path: typepy/converter/_datetime.py
from datetime import date, datetime
from .._common import strip_ansi_escape
from .._const import DefaultValue, ParamKey
from ..error import TypeConversionError
from ._interface import AbstractValueConverter
        from ..type._integer import Integer
        from ..type._realnumber import RealNumber
        from packaging.version import InvalidVersion, Version
        import dateutil.parser
        import pytz


    def force_convert(self):
        self.__datetime = self.__from_datetime()
        if self.__datetime:
            return self.__datetime

        self.__datetime = self.__from_timestamp()
        if self.__datetime:
            return self.__datetime

        return self.__from_datetime_string()

    def __from_datetime(self):
        if not isinstance(self._value, (date, datetime)):
            return None

        if isinstance(self._value, datetime):
            self.__datetime = self._value
        elif isinstance(self._value, date):
            self.__datetime = datetime(
                year=self._value.year, month=self._value.month, day=self._value.day
            )

        if self.__timezone:
            self.__datetime = self.__timezone.localize(self.__datetime)

        return self.__datetime

    def __from_timestamp(self):


        conv_error = TypeConversionError(