# Path: inspire_schemas/utils.py
# EMPTIES = [None, '', [], {}]
# 
# def filter_empty_parameters(func):
#     """Decorator that is filtering empty parameters.
# 
#     :param func: function that you want wrapping
#     :type func: function
#     """
#     @wraps(func)
#     def func_wrapper(self, *args, **kwargs):
#         my_kwargs = {key: value for key, value in kwargs.items()
#                      if value not in EMPTIES}
#         args_is_empty = all(arg in EMPTIES for arg in args)
# 
#         if (
#                 {'source', 'material'}.issuperset(my_kwargs) or not my_kwargs
#         ) and args_is_empty:
#             return
#         return func(self, *args, **my_kwargs)
# 
#     return func_wrapper


import six
from ..utils import EMPTIES, filter_empty_parameters
# as an Intergovernmental Organization or submit itself to any jurisdiction.

from __future__ import absolute_import, division, print_function




class RecordBuilder(object):
    """Base record builder."""

    _collections = []

    def __init__(self, record=None, source=None):
        if record is None:
            record = {'_collections': [_ for _ in self.__class__._collections]}
        self.record = record
        self.source = source

    def __repr__(self):
        """Printable representation of the builder."""
        return u'{}(source={!r}, record={})'.format(
            type(self).__name__,
            self.source,
            self.record
        )

    @filter_empty_parameters
    def _append_to(self, field, element=None, default_list=None, **kwargs):
        if default_list is None:
            default_list = []

# Path: inspire_schemas/utils.py
# EMPTIES = [None, '', [], {}]
# 
# def filter_empty_parameters(func):
#     """Decorator that is filtering empty parameters.
# 
#     :param func: function that you want wrapping
#     :type func: function
#     """
#     @wraps(func)
#     def func_wrapper(self, *args, **kwargs):
#         my_kwargs = {key: value for key, value in kwargs.items()
#                      if value not in EMPTIES}
#         args_is_empty = all(arg in EMPTIES for arg in args)
# 
#         if (
#                 {'source', 'material'}.issuperset(my_kwargs) or not my_kwargs
#         ) and args_is_empty:
#             return
#         return func(self, *args, **my_kwargs)
# 
#     return func_wrapper


# Path: inspire_schemas/builders/builder.py
import six
from ..utils import EMPTIES, filter_empty_parameters

# as an Intergovernmental Organization or submit itself to any jurisdiction.

from __future__ import absolute_import, division, print_function




class RecordBuilder(object):
    """Base record builder."""

    _collections = []

    def __init__(self, record=None, source=None):
        if record is None:
            record = {'_collections': [_ for _ in self.__class__._collections]}
        self.record = record
        self.source = source

    def __repr__(self):
        """Printable representation of the builder."""
        return u'{}(source={!r}, record={})'.format(
            type(self).__name__,
            self.source,
            self.record
        )

    @filter_empty_parameters
    def _append_to(self, field, element=None, default_list=None, **kwargs):
        if default_list is None:
            default_list = []

        if element not in EMPTIES: