# Path: elasticmagic/expression.py
# class Params(Expression, Mapping):
#     __visit_name__ = 'params'
# 
#     def __init__(self, *args, **kwargs):
#         params = {}
#         for d in args:
#             params.update(d)
#         params.update(kwargs)
#         self._params = {}
#         for k, v in clean_params(params).items():
#             if k.endswith('_') and not k.startswith('_'):
#                 k = k.rstrip('_')
#             self._params[k] = v
# 
#     def _collect_doc_classes(self):
#         return collect_doc_classes(self._params)
# 
#     def __len__(self):
#         return len(self._params)
# 
#     def __iter__(self):
#         return iter(self._params)
# 
#     def __getitem__(self, key):
#         return self._params[key]
# 
#     def __contains__(self, key):
#         return key in self._params
# 
# class ParamsExpression(Expression):
#     def __init__(self, **kwargs):
#         super(ParamsExpression, self).__init__()
#         self.params = Params(kwargs)
# 
#     def _collect_doc_classes(self):
#         return collect_doc_classes(self.params)


from .expression import Params, ParamsExpression



class Function(ParamsExpression):
    __visit_name__ = 'function'

    def __init__(self, filter=None, weight=None, **kwargs):
        self.filter = filter
        self.weight = weight
        super(Function, self).__init__(**kwargs)



# Path: elasticmagic/expression.py
# class Params(Expression, Mapping):
#     __visit_name__ = 'params'
# 
#     def __init__(self, *args, **kwargs):
#         params = {}
#         for d in args:
#             params.update(d)
#         params.update(kwargs)
#         self._params = {}
#         for k, v in clean_params(params).items():
#             if k.endswith('_') and not k.startswith('_'):
#                 k = k.rstrip('_')
#             self._params[k] = v
# 
#     def _collect_doc_classes(self):
#         return collect_doc_classes(self._params)
# 
#     def __len__(self):
#         return len(self._params)
# 
#     def __iter__(self):
#         return iter(self._params)
# 
#     def __getitem__(self, key):
#         return self._params[key]
# 
#     def __contains__(self, key):
#         return key in self._params
# 
# class ParamsExpression(Expression):
#     def __init__(self, **kwargs):
#         super(ParamsExpression, self).__init__()
#         self.params = Params(kwargs)
# 
#     def _collect_doc_classes(self):
#         return collect_doc_classes(self.params)


# Path: elasticmagic/function.py
from .expression import Params, ParamsExpression




class Function(ParamsExpression):
    __visit_name__ = 'function'

    def __init__(self, filter=None, weight=None, **kwargs):
        self.filter = filter
        self.weight = weight
        super(Function, self).__init__(**kwargs)



class Weight(Function):