@silence_warnings
def to_dict(entity, skip=()):
    def dict_iter(items):
        return [x.to_dict() if is_dictable(x) else x for x in items]


    d = {}
    for name, field in iter_vars(entity):
        key = key_name(name)

        if key in skip or not has_value(field):
            continue

        if is_dictable(field):
            d[key] = field.to_dict()
        elif is_timestamp(field):
            d[key] = dates.serialize_value(field)
        elif is_date(field):
            d[key] = dates.serialize_date(field)
        elif mixbox.xml.is_element(field) or mixbox.xml.is_etree(field):
            d[key] = lxml.etree.tostring(field)
        elif is_sequence(field):
            d[key] = dict_iter(field)
        else:
            d[key] = field

    return d
Lead field dot products using Legendre polynomial (P_n) series
dataset/ETHPy150Open STIXProject/python-stix/stix/utils/__init__.py/to_dict--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/forward/_lead_dots.py/_comp_sum_eeg