# Path: khayyam/compat.py
# def get_unicode(s):
#     if _py3:  # pragma: no cover
#         return str(s)
#     else:  # pragma: no cover
#         # noinspection PyCompatibility
#         return unicode(s)


from khayyam.compat import get_unicode
        from khayyam.formatting import JalaliDateFormatter
        from khayyam.formatting import JalaliDatetimeFormatter
        In overridden method, It should parse the formatted value from the given string.
        :param ctx:
        :param formatter:
        :return:
        """
        pass

    def format(self, d):  # pragma: no cover
        """
        In overridden method, It Should return string representation of the given argument.

        :param d: a value to format
        :return: Formatted value.
        :rtype: str
        """
        return d


class CompositeDateDirective(Directive):
    """
    A chain of directives, Representing a date.

    """

    format_string = None

    def __init__(self, key, name, regex, format_string=None, **kw):
        if format_string:
            self.format_string = format_string
            self._sub_formatter = None

# Path: khayyam/compat.py
# def get_unicode(s):
#     if _py3:  # pragma: no cover
#         return str(s)
#     else:  # pragma: no cover
#         # noinspection PyCompatibility
#         return unicode(s)


# Path: khayyam/formatting/directives/base.py
from khayyam.compat import get_unicode
        from khayyam.formatting import JalaliDateFormatter
        from khayyam.formatting import JalaliDatetimeFormatter

        In overridden method, It should parse the formatted value from the given string.
        :param ctx:
        :param formatter:
        :return:
        """
        pass

    def format(self, d):  # pragma: no cover
        """
        In overridden method, It Should return string representation of the given argument.

        :param d: a value to format
        :return: Formatted value.
        :rtype: str
        """
        return d


class CompositeDateDirective(Directive):
    """
    A chain of directives, Representing a date.

    """

    format_string = None

    def __init__(self, key, name, regex, format_string=None, **kw):
        if format_string:
            self.format_string = format_string
            self._sub_formatter = None

        super(CompositeDateDirective, self).__init__(key, name, regex, get_unicode, **kw)