# Path: inspire_schemas/builders/builder.py
# 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:
#             self._ensure_list_field(field, default_list)
#             if element not in self.record[field]:
#                 self.record[field].append(element)
#         elif kwargs:
#             if 'record' in kwargs and isinstance(kwargs['record'], six.string_types):
#                 kwargs['record'] = {'$ref': kwargs['record']}
#             self._ensure_list_field(field, default_list)
#             if kwargs not in self.record[field]:
#                 self.record[field].append(kwargs)
# 
#     def _ensure_field(self, field_name, default_value, obj=None):
#         if obj is None:
#             obj = self.record
#         if field_name not in obj:
#             obj[field_name] = default_value
# 
#     def _ensure_list_field(self, field_name, default_value=None, obj=None):
#         if default_value is None:
#             default_value = []
#         self._ensure_field(field_name, default_value, obj)
# 
#     def _ensure_dict_field(self, field_name, default_value=None, obj=None):
#         if default_value is None:
#             default_value = {}
#         self._ensure_field(field_name, default_value, obj)
# 
#     def _sourced_dict(self, source=None, **kwargs):
#         if source:
#             kwargs['source'] = source
#         elif self.source:
#             kwargs['source'] = self.source
# 
#         return {key: value for key, value in kwargs.items() if value not in EMPTIES}
# 
# Path: inspire_schemas/utils.py
# 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
# 
# def load_schema(schema_name, resolved=False, _cache={}):
#     """Load the given schema from wherever it's installed.
# 
#     Args:
#         schema_name(str): Name of the schema to load, for example 'authors'.
#         resolved(bool): If True will return the resolved schema, that is with
#             all the $refs replaced by their targets.
#         _cache(dict): Private argument used for memoization.
# 
#     Returns:
#         dict: the schema with the given name.
#     """
#     if schema_name in _cache:
#         return _cache[schema_name]
# 
#     schema_path = get_schema_path(schema_name, resolved)
#     if schema_path in _cache:
#         schema_data = _cache[schema_path]
#         _cache[schema_name] = schema_data
#         return schema_data
# 
#     with open(schema_path) as schema_fd:
#         schema_data = json.load(schema_fd)
# 
#     _cache[schema_name] = schema_data
#     _cache[schema_path] = schema_data
# 
#     return schema_data


from inspire_schemas.builders.builder import RecordBuilder
from inspire_schemas.utils import filter_empty_parameters, load_schema
from inspire_utils.date import normalize_date, PartialDate
from inspire_utils.helpers import force_list
from inspire_utils.name import normalize_name
from inspire_utils.record import get_value
            :type id_: string
        """
        self._append_to('ids', {
            'value': id_,
            'schema': 'ORCID',
        })

    @filter_empty_parameters
    def add_bai(self, id_):
        """Add an inspire  BAI identifier.

        Args:
            :param id_: The BAI.
            :type id_: string
        """
        self._append_to('ids', {
            'value': id_,
            'schema': 'INSPIRE BAI',
        })

    @filter_empty_parameters
    def add_arxiv_category(self, category):
        """Add a field of research.

        Args:
            :param category: valid arxiv category related to the field of research.
            :type category: string
        """
        self._append_to('arxiv_categories', category)


# Path: inspire_schemas/builders/builder.py
# 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:
#             self._ensure_list_field(field, default_list)
#             if element not in self.record[field]:
#                 self.record[field].append(element)
#         elif kwargs:
#             if 'record' in kwargs and isinstance(kwargs['record'], six.string_types):
#                 kwargs['record'] = {'$ref': kwargs['record']}
#             self._ensure_list_field(field, default_list)
#             if kwargs not in self.record[field]:
#                 self.record[field].append(kwargs)
# 
#     def _ensure_field(self, field_name, default_value, obj=None):
#         if obj is None:
#             obj = self.record
#         if field_name not in obj:
#             obj[field_name] = default_value
# 
#     def _ensure_list_field(self, field_name, default_value=None, obj=None):
#         if default_value is None:
#             default_value = []
#         self._ensure_field(field_name, default_value, obj)
# 
#     def _ensure_dict_field(self, field_name, default_value=None, obj=None):
#         if default_value is None:
#             default_value = {}
#         self._ensure_field(field_name, default_value, obj)
# 
#     def _sourced_dict(self, source=None, **kwargs):
#         if source:
#             kwargs['source'] = source
#         elif self.source:
#             kwargs['source'] = self.source
# 
#         return {key: value for key, value in kwargs.items() if value not in EMPTIES}
# 
# Path: inspire_schemas/utils.py
# 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
# 
# def load_schema(schema_name, resolved=False, _cache={}):
#     """Load the given schema from wherever it's installed.
# 
#     Args:
#         schema_name(str): Name of the schema to load, for example 'authors'.
#         resolved(bool): If True will return the resolved schema, that is with
#             all the $refs replaced by their targets.
#         _cache(dict): Private argument used for memoization.
# 
#     Returns:
#         dict: the schema with the given name.
#     """
#     if schema_name in _cache:
#         return _cache[schema_name]
# 
#     schema_path = get_schema_path(schema_name, resolved)
#     if schema_path in _cache:
#         schema_data = _cache[schema_path]
#         _cache[schema_name] = schema_data
#         return schema_data
# 
#     with open(schema_path) as schema_fd:
#         schema_data = json.load(schema_fd)
# 
#     _cache[schema_name] = schema_data
#     _cache[schema_path] = schema_data
# 
#     return schema_data


# Path: inspire_schemas/builders/authors.py
from inspire_schemas.builders.builder import RecordBuilder
from inspire_schemas.utils import filter_empty_parameters, load_schema
from inspire_utils.date import normalize_date, PartialDate
from inspire_utils.helpers import force_list
from inspire_utils.name import normalize_name
from inspire_utils.record import get_value

            :type id_: string
        """
        self._append_to('ids', {
            'value': id_,
            'schema': 'ORCID',
        })

    @filter_empty_parameters
    def add_bai(self, id_):
        """Add an inspire  BAI identifier.

        Args:
            :param id_: The BAI.
            :type id_: string
        """
        self._append_to('ids', {
            'value': id_,
            'schema': 'INSPIRE BAI',
        })

    @filter_empty_parameters
    def add_arxiv_category(self, category):
        """Add a field of research.

        Args:
            :param category: valid arxiv category related to the field of research.
            :type category: string
        """
        self._append_to('arxiv_categories', category)


    @filter_empty_parameters