# Path: dynts/conf.py
# def toupper(x):
#     def __init__(self):
#     def special_operators(self):
#     def getdc(self):
#     def ismissing(self, value):
# class Settings(object):
# 
# Path: dynts/exc.py
# class DateNotFound(DyntsException):
#     '''A :class:`DyntsException` exception raised when
#     a date is not found in a :class:`dynts.TimeSeries`.'''
#     pass
# 
# class OutOfBound(DyntsException):
#     '''A :class:`DyntsException` exception raised when
#     trying to access :class:`dynts.TimeSeries` outside its dates range.
#     '''
#     pass
# 
# class RightOutOfBound(OutOfBound):
#     '''A :class:`DyntsOutOfBound` exception raised when
#     trying to access :class:`dynts.TimeSeries` after the end date.'''
#     pass
# 
# Path: dynts/utils/section.py
# def asarray(x, dtype=None):
#     '''Convert ``x`` into a ``numpy.ndarray``.'''
#     iterable = scalarasiter(x)
#     if isinstance(iterable, ndarray):
#         return iterable
#     else:
#         if not hasattr(iterable, '__len__'):
#             iterable = list(iterable)
#         if dtype == object_type:
#             a = ndarray((len(iterable),), dtype=dtype)
#             for i,v in enumerate(iterable):
#                 a[i] = v
#             return a
#         else:
#             return array(iterable, dtype=dtype)


from bisect import bisect_left, bisect_right
from numpy import ndarray
from ..conf import settings
from ..exc import DateNotFound, OutOfBound, RightOutOfBound
from .section import asarray


    def __getitem__(self, dt):
        '''Get the value at *dt* otherwise it raises
an :class:`dynts.exceptions.DateNotFound`.'''
        try:
            return dict.__getitem__(self, dt)
        except KeyError:
            raise DateNotFound

    def __setitem__(self, dt, item):
        # if the timeseries contains objects, the items must be a numpy array
        # otherwise we put it into a 1 element array.
        if self.ts.is_object and not isinstance(item, ndarray):
            t, item = item, ndarray((1, ), dtype = self.ts.dtype)
            item[0] = t
        dict.__setitem__(self, dt, item)
        self.modified = True

    def __iter__(self):
        dates = sorted(dict.__iter__(self))
        if settings.desc:
            dates = reversed(dates)
        return iter(dates)

    def items(self):
        for dt in self:
            yield dt, self[dt]

    def getts(self):
        if self.modified:

# Path: dynts/conf.py
# def toupper(x):
#     def __init__(self):
#     def special_operators(self):
#     def getdc(self):
#     def ismissing(self, value):
# class Settings(object):
# 
# Path: dynts/exc.py
# class DateNotFound(DyntsException):
#     '''A :class:`DyntsException` exception raised when
#     a date is not found in a :class:`dynts.TimeSeries`.'''
#     pass
# 
# class OutOfBound(DyntsException):
#     '''A :class:`DyntsException` exception raised when
#     trying to access :class:`dynts.TimeSeries` outside its dates range.
#     '''
#     pass
# 
# class RightOutOfBound(OutOfBound):
#     '''A :class:`DyntsOutOfBound` exception raised when
#     trying to access :class:`dynts.TimeSeries` after the end date.'''
#     pass
# 
# Path: dynts/utils/section.py
# def asarray(x, dtype=None):
#     '''Convert ``x`` into a ``numpy.ndarray``.'''
#     iterable = scalarasiter(x)
#     if isinstance(iterable, ndarray):
#         return iterable
#     else:
#         if not hasattr(iterable, '__len__'):
#             iterable = list(iterable)
#         if dtype == object_type:
#             a = ndarray((len(iterable),), dtype=dtype)
#             for i,v in enumerate(iterable):
#                 a[i] = v
#             return a
#         else:
#             return array(iterable, dtype=dtype)


# Path: dynts/utils/wrappers.py
from bisect import bisect_left, bisect_right
from numpy import ndarray
from ..conf import settings
from ..exc import DateNotFound, OutOfBound, RightOutOfBound
from .section import asarray


    def __getitem__(self, dt):
        '''Get the value at *dt* otherwise it raises
an :class:`dynts.exceptions.DateNotFound`.'''
        try:
            return dict.__getitem__(self, dt)
        except KeyError:
            raise DateNotFound

    def __setitem__(self, dt, item):
        # if the timeseries contains objects, the items must be a numpy array
        # otherwise we put it into a 1 element array.
        if self.ts.is_object and not isinstance(item, ndarray):
            t, item = item, ndarray((1, ), dtype = self.ts.dtype)
            item[0] = t
        dict.__setitem__(self, dt, item)
        self.modified = True

    def __iter__(self):
        dates = sorted(dict.__iter__(self))
        if settings.desc:
            dates = reversed(dates)
        return iter(dates)

    def items(self):
        for dt in self:
            yield dt, self[dt]

    def getts(self):
        if self.modified:

            name = settings.splittingnames.join(self.names)
