human
Complete this python program:
def autoassign(self, locals):
assistant
#Here is the Python code you requested.

    """Automatically assigns local variables to `self`.
    >>> self = storage()
    >>> autoassign(self, dict(a=1, b=2))
    >>> self.a
    1
    >>> self.b
    2
    Generally used in `__init__` methods, as in:
    def __init__(self, foo, bar, baz=1): autoassign(self, locals())
    """
    for (key, value) in iteritems(locals):
        if (key == 'self'):
            continue
        setattr(self, key, value)