'Return a :class:`Label` object for the
given :class:`.ColumnElement`.
A label changes the name of an element in the columns clause of a
``SELECT`` statement, typically via the ``AS`` SQL keyword.
This functionality is more conveniently available via the
:meth:`.ColumnElement.label` method on :class:`.ColumnElement`.
:param name: label name
:param obj: a :class:`.ColumnElement`.'

def __init__(self, name, element, type_=None):

    while isinstance(element, Label):
        element = element.element
    if name:
        self.name = name
    else:
        self.name = _anonymous_label((u'%%(%d    %s)s' % (id(self), getattr(element, u'name', u'anon'))))
    self.key = self._label = self._key_label = self.name
    self._element = element
    self._type = type_
    self._proxies = [element]
