# Path: wa/framework/exception.py
# class SerializerSyntaxError(Exception):
#     """
#     Error loading a serialized structure from/to a file handle.
#     """
#     @property
#     def message(self):
#         if self.args:
#             return self.args[0]
#         return ''
# 
#     def __init__(self, message, line=None, column=None):
#         super(SerializerSyntaxError, self).__init__(message)
#         self.line = line
#         self.column = column
# 
#     def __str__(self):
#         linestring = ' on line {}'.format(self.line) if self.line else ''
#         colstring = ' in column {}'.format(self.column) if self.column else ''
#         message = 'Syntax Error{}: {}'
#         return message.format(''.join([linestring, colstring]), self.message)


import os
import re
import json as _json
import dateutil.parser
import yaml as _yaml  # pylint: disable=wrong-import-order
from collections import OrderedDict
from collections.abc import Hashable
from datetime import datetime
from yaml import MappingNode
    from yaml import FullLoader as _yaml_loader
    from yaml import Loader as _yaml_loader
from yaml.constructor import ConstructorError
from past.builtins import basestring  # pylint: disable=wrong-import-order
from wa.framework.exception import SerializerSyntaxError
from wa.utils.misc import isiterable
from wa.utils.types import regex_type, none_type, level, cpu_mask
    @staticmethod
    def load(fh, *args, **kwargs):
        try:
            return _yaml.load(fh, *args, Loader=_WaYamlLoader, **kwargs)
        except _yaml.YAMLError as e:
            lineno = None
            if hasattr(e, 'problem_mark'):
                lineno = e.problem_mark.line  # pylint: disable=no-member
            message = e.args[0] if (e.args and e.args[0]) else str(e)
            raise SerializerSyntaxError(message, lineno)

    loads = load


class python(object):

    @staticmethod
    def dump(o, wfh, *args, **kwargs):
        raise NotImplementedError()

    @classmethod
    def load(cls, fh, *args, **kwargs):
        return cls.loads(fh.read())

    @staticmethod
    def loads(s, *args, **kwargs):
        pod = {}
        try:
            exec(s, pod)  # pylint: disable=exec-used
        except SyntaxError as e:

# Path: wa/framework/exception.py
# class SerializerSyntaxError(Exception):
#     """
#     Error loading a serialized structure from/to a file handle.
#     """
#     @property
#     def message(self):
#         if self.args:
#             return self.args[0]
#         return ''
# 
#     def __init__(self, message, line=None, column=None):
#         super(SerializerSyntaxError, self).__init__(message)
#         self.line = line
#         self.column = column
# 
#     def __str__(self):
#         linestring = ' on line {}'.format(self.line) if self.line else ''
#         colstring = ' in column {}'.format(self.column) if self.column else ''
#         message = 'Syntax Error{}: {}'
#         return message.format(''.join([linestring, colstring]), self.message)


# Path: wa/utils/serializer.py
import os
import re
import json as _json
import dateutil.parser
import yaml as _yaml  # pylint: disable=wrong-import-order
from collections import OrderedDict
from collections.abc import Hashable
from datetime import datetime
from yaml import MappingNode
    from yaml import FullLoader as _yaml_loader
    from yaml import Loader as _yaml_loader
from yaml.constructor import ConstructorError
from past.builtins import basestring  # pylint: disable=wrong-import-order
from wa.framework.exception import SerializerSyntaxError
from wa.utils.misc import isiterable
from wa.utils.types import regex_type, none_type, level, cpu_mask

    @staticmethod
    def load(fh, *args, **kwargs):
        try:
            return _yaml.load(fh, *args, Loader=_WaYamlLoader, **kwargs)
        except _yaml.YAMLError as e:
            lineno = None
            if hasattr(e, 'problem_mark'):
                lineno = e.problem_mark.line  # pylint: disable=no-member
            message = e.args[0] if (e.args and e.args[0]) else str(e)
            raise SerializerSyntaxError(message, lineno)

    loads = load


class python(object):

    @staticmethod
    def dump(o, wfh, *args, **kwargs):
        raise NotImplementedError()

    @classmethod
    def load(cls, fh, *args, **kwargs):
        return cls.loads(fh.read())

    @staticmethod
    def loads(s, *args, **kwargs):
        pod = {}
        try:
            exec(s, pod)  # pylint: disable=exec-used
        except SyntaxError as e:

            raise SerializerSyntaxError(e.message, e.lineno)