def load(name, records, antennas, attributes=None, recharges=None,
         antennas_path=None, attributes_path=None, recharges_path=None,
         describe=False, warnings=False, drop_duplicates=False):
    """
    Low-level function to create a new user. This function is used by
    read_csv, read_orange, and read_telenor.

    `load` is a low-level function which:

    - assigns records, antennas, and attributes to a new
      :class:`~bandicoot.core.User` object,
    - outputs warnings on the standard output if records or
      antennas are missing fields or have wrong values,
    - filters records with wrong values and drop duplicates records if
      asked.


    Parameters
    ----------
    name : str
        The name of the user. It is stored in User.name and is useful when
        exporting metrics about multiple users.

    records : list
        List of :class:`~bandicoot.core.Record` objects.

    antennas : dict
        Dictionary of the position for each antenna.

    attributes : dict
        A (key,value) dictionary of attributes for the current user

    recharges : list
        List of :class:`~bandicoot.core.Recharge` objects.

    antennas_path : str
        Path of the antenna file. It will be stored in
        :attr:`User.antennas_path <bandicoot.core.User.antennas_path>`.

    attributes_path : str
        Path of the attributes file. It will be stored in
        :attr:`User.attributes_path <bandicoot.core.User.attributes_path>`.

    recharges_path : str
        Path of the recharges file. It will be stored in
        :attr:`User.recharges_path <bandicoot.core.User.recharges_path>`.

    describe : boolean, default: False
        Print a description of the loaded user to the standard output.

    warnings : boolean, default: True
        Output warnings on the standard output.

    drop_duplicates : boolean, default False
        Remove duplicate records, and issue a warning message with the number
        of removed records.


    Examples
    --------


    .. code-block:: python

       >>> records = [Record(...),...]
       >>> antennas = {'A51': (37.245265, 115.803418),...}
       >>> attributes = {'age': 60}
       >>> load("Frodo", records, antennas, attributes)

    will returns a new User object.
    """

    user = User()
    user.name = name
    user.antennas_path = antennas_path
    user.attributes_path = attributes_path
    user.recharges_path = recharges_path

    user.records, ignored, bad_records = filter_record(records)

    _level = log.getLogger().level
    if warnings is False:
        log.getLogger().setLevel(log.ERROR)

    if ignored['all'] != 0:
        w = "{} record(s) were removed due to " \
            "missing or incomplete fields.".format(ignored['all'])
        for k in ignored.keys():
            if k != 'all' and ignored[k] != 0:
                w += "\n" + " " * 9 + "%s: %i record(s) with " \
                     "incomplete values" % (k, ignored[k])
        log.warn(w)

    user.ignored_records = dict(ignored)

    if antennas is not None:
        user.antennas = antennas
    if attributes is not None:
        user.attributes = attributes
    if recharges is not None:
        user.recharges = recharges

    if not user.has_attributes and user.attributes_path is not None:
        log.warn("Attributes path {} is given, but no "
                 "attributes are loaded.".format(attributes_path))

    if not user.has_recharges and user.recharges_path is not None:
        log.warn("Recharges path {} is given, but no "
                 "recharges are loaded.".format(recharges_path))

    percent_missing = percent_records_missing_location(user)
    if percent_missing > 0:
        w = "{0:.2%} of the records are missing " \
            "a location.".format(percent_missing)
        if antennas is None:
            w += "\n" + " " * 9 + "No antennas file was given and " \
                 "records are using antennas for position."
        log.warn(w)

    msg_loc = antennas_missing_locations(user)
    if msg_loc > 0:
        log.warn("{} antenna(s) are missing a location.".format(msg_loc))

    sorted_min_records = sorted(set(user.records), key=lambda r: r.datetime)
    num_dup = len(user.records) - len(sorted_min_records)
    if num_dup > 0:
        if drop_duplicates:
            user.records = sorted_min_records
            log.error("{0:d} duplicated record(s) were "
                      "removed.".format(num_dup), extra={'prefix': "Warning!"})
        else:
            log.warn("{0:d} record(s) are duplicated.".format(num_dup))

    pct_overlap_calls = percent_overlapping_calls(user.records, 300)
    if pct_overlap_calls > 0:
        log.warn("{0:.2%} of calls overlap the next call by more than "
                 "5 minutes.".format(pct_overlap_calls))

    if describe:
        user.describe()

    log.getLogger().setLevel(_level)
    return user, bad_records
Low-level function to create a new user. This function is used by
    read_csv, read_orange, and read_telenor.

    `load` is a low-level function which:

    - assigns records, antennas, and attributes to a new
      :class:`~bandicoot.core.User` object,
    - outputs warnings on the standard output if records or
      antennas are missing fields or have wrong values,
    - filters records with wrong values and drop duplicates records if
      asked.


    Parameters
    ----------
    name : str
        The name of the user. It is stored in User.name and is useful when
        exporting metrics about multiple users.

    records : list
        List of :class:`~bandicoot.core.Record` objects.

    antennas : dict
        Dictionary of the position for each antenna.

    attributes : dict
        A (key,value) dictionary of attributes for the current user

    recharges : list
        List of :class:`~bandicoot.core.Recharge` objects.

    antennas_path : str
        Path of the antenna file. It will be stored in
        :attr:`User.antennas_path <bandicoot.core.User.antennas_path>`.

    attributes_path : str
        Path of the attributes file. It will be stored in
        :attr:`User.attributes_path <bandicoot.core.User.attributes_path>`.

    recharges_path : str
        Path of the recharges file. It will be stored in
        :attr:`User.recharges_path <bandicoot.core.User.recharges_path>`.

    describe : boolean, default: False
        Print a description of the loaded user to the standard output.

    warnings : boolean, default: True
        Output warnings on the standard output.

    drop_duplicates : boolean, default False
        Remove duplicate records, and issue a warning message with the number
        of removed records.


    Examples
    --------


    .. code-block:: python

       >>> records = [Record(...),...]
       >>> antennas = {'A51': (37.245265, 115.803418),...}
       >>> attributes = {'age': 60}
       >>> load("Frodo", records, antennas, attributes)

    will returns a new User object.