# Path: openformats/exceptions.py
# class ParseError(OpenformatsError):
#     pass
# 
# Path: openformats/utils/compat.py
# def ensure_unicode(pattern):
#     if isinstance(pattern, six.binary_type):
#         pattern = pattern.decode('utf-8')
#     return pattern
# 
# Path: openformats/formats/yaml/constants.py
# YAML_BINARY_ID = u'tag:yaml.org,2002:binary'
# 
# YAML_STRING_ID = u'tag:yaml.org,2002:str'
# 
# Path: openformats/formats/yaml/yaml_representee_classes.py
# class BlockList(list):
#     pass
# 
# class BlockStyleOrderedDict(OrderedDict):
#     pass
# 
# class FlowList(list):
#     pass
# 
# class FlowStyleOrderedDict(OrderedDict):
#     pass
# 
# class double_quoted_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# class folded_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# class literal_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# class plain_unicode(six.text_type):  # noqa: N801
# 
#     def __new__(self, value, tag=None):
#         self = super(plain_unicode, self).__new__(self, value)
#         self.tag = tag or YAML_STRING_ID
#         return self
# 
#     pass
# 
# class single_quoted_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# Path: openformats/formats/yaml/yaml_representers.py
# def block_list_representer(dumper, data):
#     return dumper.represent_sequence(YAML_LIST_ID, data, flow_style=False)
# 
# def block_style_ordered_dict_representer(dumper, data):
#     return dumper.represent_mapping(YAML_DICT_ID, six.iteritems(data),
#                                     flow_style=False)
# 
# def double_quoted_unicode_representer(dumper, data):
#     tag = getattr(data, 'tag', YAML_STRING_ID)
#     return dumper.represent_scalar(tag, data, style='"')
# 
# def flow_list_representer(dumper, data):
#     return dumper.represent_sequence(YAML_LIST_ID, data, flow_style=True)
# 
# def flow_style_ordered_dict_representer(dumper, data):
#     return dumper.represent_mapping(YAML_DICT_ID, six.iteritems(data),
#                                     flow_style=True)
# 
# def folded_unicode_representer(dumper, data):
#     return dumper.represent_scalar(YAML_STRING_ID, data, style='>')
# 
# def literal_unicode_representer(dumper, data):
#     return dumper.represent_scalar(YAML_STRING_ID, data, style='|')
# 
# def ordered_dict_representer(dumper, data):
#     return dumper.represent_dict(six.iteritems(data))
# 
# def single_quoted_unicode_representer(dumper, data):
#     tag = getattr(data, 'tag', YAML_STRING_ID)
#     return dumper.represent_scalar(tag, data, style="'")
# 
# def unicode_representer(dumper, data):
#     tag = getattr(data, 'tag', YAML_STRING_ID)
#     return yaml.ScalarNode(tag=tag, value=data)


import re
import six
import yaml
from collections import OrderedDict, namedtuple
from yaml.constructor import ConstructorError
from openformats.exceptions import ParseError
from openformats.utils.compat import ensure_unicode
from .constants import YAML_BINARY_ID, YAML_STRING_ID
from .yaml_representee_classes import (BlockList, BlockStyleOrderedDict,
                                       FlowList, FlowStyleOrderedDict,
                                       double_quoted_unicode, folded_unicode,
                                       literal_unicode, plain_unicode,
                                       single_quoted_unicode)
from .yaml_representers import (block_list_representer,
                                block_style_ordered_dict_representer,
                                double_quoted_unicode_representer,
                                flow_list_representer,
                                flow_style_ordered_dict_representer,
                                folded_unicode_representer,
                                literal_unicode_representer,
                                ordered_dict_representer,
                                single_quoted_unicode_representer,
                                unicode_representer)
from __future__ import absolute_import





yaml.add_representer(six.text_type, unicode_representer)
yaml.add_representer(plain_unicode, unicode_representer)

# Path: openformats/exceptions.py
# class ParseError(OpenformatsError):
#     pass
# 
# Path: openformats/utils/compat.py
# def ensure_unicode(pattern):
#     if isinstance(pattern, six.binary_type):
#         pattern = pattern.decode('utf-8')
#     return pattern
# 
# Path: openformats/formats/yaml/constants.py
# YAML_BINARY_ID = u'tag:yaml.org,2002:binary'
# 
# YAML_STRING_ID = u'tag:yaml.org,2002:str'
# 
# Path: openformats/formats/yaml/yaml_representee_classes.py
# class BlockList(list):
#     pass
# 
# class BlockStyleOrderedDict(OrderedDict):
#     pass
# 
# class FlowList(list):
#     pass
# 
# class FlowStyleOrderedDict(OrderedDict):
#     pass
# 
# class double_quoted_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# class folded_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# class literal_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# class plain_unicode(six.text_type):  # noqa: N801
# 
#     def __new__(self, value, tag=None):
#         self = super(plain_unicode, self).__new__(self, value)
#         self.tag = tag or YAML_STRING_ID
#         return self
# 
#     pass
# 
# class single_quoted_unicode(plain_unicode):  # noqa: N801
#     pass
# 
# Path: openformats/formats/yaml/yaml_representers.py
# def block_list_representer(dumper, data):
#     return dumper.represent_sequence(YAML_LIST_ID, data, flow_style=False)
# 
# def block_style_ordered_dict_representer(dumper, data):
#     return dumper.represent_mapping(YAML_DICT_ID, six.iteritems(data),
#                                     flow_style=False)
# 
# def double_quoted_unicode_representer(dumper, data):
#     tag = getattr(data, 'tag', YAML_STRING_ID)
#     return dumper.represent_scalar(tag, data, style='"')
# 
# def flow_list_representer(dumper, data):
#     return dumper.represent_sequence(YAML_LIST_ID, data, flow_style=True)
# 
# def flow_style_ordered_dict_representer(dumper, data):
#     return dumper.represent_mapping(YAML_DICT_ID, six.iteritems(data),
#                                     flow_style=True)
# 
# def folded_unicode_representer(dumper, data):
#     return dumper.represent_scalar(YAML_STRING_ID, data, style='>')
# 
# def literal_unicode_representer(dumper, data):
#     return dumper.represent_scalar(YAML_STRING_ID, data, style='|')
# 
# def ordered_dict_representer(dumper, data):
#     return dumper.represent_dict(six.iteritems(data))
# 
# def single_quoted_unicode_representer(dumper, data):
#     tag = getattr(data, 'tag', YAML_STRING_ID)
#     return dumper.represent_scalar(tag, data, style="'")
# 
# def unicode_representer(dumper, data):
#     tag = getattr(data, 'tag', YAML_STRING_ID)
#     return yaml.ScalarNode(tag=tag, value=data)


# Path: openformats/formats/yaml/utils.py
import re
import six
import yaml
from collections import OrderedDict, namedtuple
from yaml.constructor import ConstructorError
from openformats.exceptions import ParseError
from openformats.utils.compat import ensure_unicode
from .constants import YAML_BINARY_ID, YAML_STRING_ID
from .yaml_representee_classes import (BlockList, BlockStyleOrderedDict,
                                       FlowList, FlowStyleOrderedDict,
                                       double_quoted_unicode, folded_unicode,
                                       literal_unicode, plain_unicode,
                                       single_quoted_unicode)
from .yaml_representers import (block_list_representer,
                                block_style_ordered_dict_representer,
                                double_quoted_unicode_representer,
                                flow_list_representer,
                                flow_style_ordered_dict_representer,
                                folded_unicode_representer,
                                literal_unicode_representer,
                                ordered_dict_representer,
                                single_quoted_unicode_representer,
                                unicode_representer)

from __future__ import absolute_import





yaml.add_representer(six.text_type, unicode_representer)
yaml.add_representer(plain_unicode, unicode_representer)

yaml.add_representer(six.binary_type, unicode_representer)