def set_attrs(obj, attrs):
    o = setattr

    if hasattr(obj, '__setitem__'):
        o = type(obj).__setitem__

    [o(obj, k, v) for k, v in attrs.iteritems()]
Applies a collection of attributes C{attrs} to object C{obj} in the most
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/PyAMF-0.6.1/pyamf/util/__init__.py/set_attrs