# 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/api/timeseries.py
# def is_timeseries(value):
#     def __new__(cls, name, bases, attrs):
# def ts_merge(series):
# def ts_bin_op(op_name, ts1, ts2, all=True, fill=None, name=None):
# def ts_fn(op_name):
#     def fn(*args,  **kwargs):
#     def __init__(self, name=None, date=None, data=None, info=None,
#                  dtype=np.double, **params):
#     def dtype(self):
#     def is_object(self):
#     def getalgo(self, operation, name):
#     def register_algorithm(cls, operation, name, callable):
#     def __len__(self):
#     def count(self):
#     def dates(self, desc=None):
#     def keys(self, desc=None):
#     def values(self, desc=None):
#     def items(self, desc=None, start_value=None, shift_by=None):
#     def series(self):
#     def named_series(self, ordering=None):
#     def serie(self, index):
#     def display(self):
#     def asbtree(self):
#     def ashash(self):
#     def dateconvert(self, dte):
#     def dateinverse(self, key):
#     def insert(self, dte, value):
#     def window(self, start, end):
#     def merge(self, ts, all=True):
#     def clone(self, date=None, data=None, name=None):
#     def reduce(self, size, method='simple', **kwargs):
#     def clean(self, algorithm=None):
#     def max(self, fallback=False):
#     def min(self, fallback=False):
#     def mean(self, fallback=False):
#     def median(self, fallback=False):
#     def returns(self, fallback=False):
#     def isconsistent(self):
#     def start(self):
#     def end(self):
#     def frequency(self):
#     def shape(self):
#     def __getitem__(self, i):
#     def colnames(self):
#     def delta(self, lag=1, **kwargs):
#     def delta2(self, lag=2, **kwargs):
#     def lag(self, lag=1):
#     def log(self):
#     def sqrt(self):
#     def square(self):
#     def logdelta(self, lag=1, **kwargs):
#     def var(self, ddof=0):
#     def sd(self):
#     def apply(self, func, window=None, bycolumn=True, align=None, **kwargs):
#     def rollapply(self, func, window=20, **kwargs):
#     def rollmax(self, **kwargs):
#     def rollmin(self, **kwargs):
#     def rollmedian(self, **kwargs):
#     def rollmean(self, **kwargs):
#     def rollsd(self, scale=1, **kwargs):
#     def makename(self, func, window=None, **kwargs):
#     def _rollapply(func, window=20, **kwargs):
#     def make(self, date, data, **kwargs):
#     def precondition(self, precond, errorclass=None, msg=''):
# BACKENDS = {}
#         N = len(self)
#         N = len(self)
# class TSmeta(type):
# class TimeSeries(Data, metaclass=TSmeta):


from functools import reduce
from dynts.conf import settings
from ...api import timeseries, is_timeseries

        for c in self.children:
            cs = str(c)
            cp = entries.get(cs,None)
            if cp:
                new_children.append(cp)
                removed.append(c)
            else:
                dups = c.removeduplicates(entries)
                if dups:
                    removed.extend(dups)
                entries[cs] = c
                new_children.append(c)
        self.children = new_children
        return removed


class ConcatOp(MultiExpression):
    '''
    Refinement of MultiExpression with a new constructor.
    This class simply define a new __init__ method
    '''
    def __init__(self, left, right, op, concatenate=True):
        super().__init__(op, concatenate=concatenate)
        self.append(left)
        self.append(right)


class ConcatenationOp(ConcatOp):

    def __init__(self, left, right):

# 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/api/timeseries.py
# def is_timeseries(value):
#     def __new__(cls, name, bases, attrs):
# def ts_merge(series):
# def ts_bin_op(op_name, ts1, ts2, all=True, fill=None, name=None):
# def ts_fn(op_name):
#     def fn(*args,  **kwargs):
#     def __init__(self, name=None, date=None, data=None, info=None,
#                  dtype=np.double, **params):
#     def dtype(self):
#     def is_object(self):
#     def getalgo(self, operation, name):
#     def register_algorithm(cls, operation, name, callable):
#     def __len__(self):
#     def count(self):
#     def dates(self, desc=None):
#     def keys(self, desc=None):
#     def values(self, desc=None):
#     def items(self, desc=None, start_value=None, shift_by=None):
#     def series(self):
#     def named_series(self, ordering=None):
#     def serie(self, index):
#     def display(self):
#     def asbtree(self):
#     def ashash(self):
#     def dateconvert(self, dte):
#     def dateinverse(self, key):
#     def insert(self, dte, value):
#     def window(self, start, end):
#     def merge(self, ts, all=True):
#     def clone(self, date=None, data=None, name=None):
#     def reduce(self, size, method='simple', **kwargs):
#     def clean(self, algorithm=None):
#     def max(self, fallback=False):
#     def min(self, fallback=False):
#     def mean(self, fallback=False):
#     def median(self, fallback=False):
#     def returns(self, fallback=False):
#     def isconsistent(self):
#     def start(self):
#     def end(self):
#     def frequency(self):
#     def shape(self):
#     def __getitem__(self, i):
#     def colnames(self):
#     def delta(self, lag=1, **kwargs):
#     def delta2(self, lag=2, **kwargs):
#     def lag(self, lag=1):
#     def log(self):
#     def sqrt(self):
#     def square(self):
#     def logdelta(self, lag=1, **kwargs):
#     def var(self, ddof=0):
#     def sd(self):
#     def apply(self, func, window=None, bycolumn=True, align=None, **kwargs):
#     def rollapply(self, func, window=20, **kwargs):
#     def rollmax(self, **kwargs):
#     def rollmin(self, **kwargs):
#     def rollmedian(self, **kwargs):
#     def rollmean(self, **kwargs):
#     def rollsd(self, scale=1, **kwargs):
#     def makename(self, func, window=None, **kwargs):
#     def _rollapply(func, window=20, **kwargs):
#     def make(self, date, data, **kwargs):
#     def precondition(self, precond, errorclass=None, msg=''):
# BACKENDS = {}
#         N = len(self)
#         N = len(self)
# class TSmeta(type):
# class TimeSeries(Data, metaclass=TSmeta):


# Path: dynts/dsl/ast/base.py
from functools import reduce
from dynts.conf import settings
from ...api import timeseries, is_timeseries

        for c in self.children:
            cs = str(c)
            cp = entries.get(cs,None)
            if cp:
                new_children.append(cp)
                removed.append(c)
            else:
                dups = c.removeduplicates(entries)
                if dups:
                    removed.extend(dups)
                entries[cs] = c
                new_children.append(c)
        self.children = new_children
        return removed


class ConcatOp(MultiExpression):
    '''
    Refinement of MultiExpression with a new constructor.
    This class simply define a new __init__ method
    '''
    def __init__(self, left, right, op, concatenate=True):
        super().__init__(op, concatenate=concatenate)
        self.append(left)
        self.append(right)


class ConcatenationOp(ConcatOp):

    def __init__(self, left, right):

        super().__init__(left, right, settings.concat_operator)
