def setting_attrs(obj, **attrs):
    """
    Save all given keyword arguments as attributes to obj and then return obj.
    """
    for k, v in attrs.items():
        setattr(obj, k, v)
    return obj