def export_attrs_as_dicts(obj, attrs):
    out = {}
    for name in attrs:
        value = getattr(obj, name, None)
        if value:
            out[name] = dict(value)
    return out
def export_attrs_as_dicts(obj, attrs):
    out = {}
    for name in attrs:
        value = getattr(obj, name, None)
        if value:
            out[name] = dict(value)
    return out