'Creates an Attribute instance with name, name_format and
friendly_name
:param attr: The local name of the attribute
:return: An Attribute instance'

def to_format(self, attr):

    try:
        return factory(saml.Attribute, name=self._to[attr], name_format=self.name_format, friendly_name=attr)
    except KeyError:
        return factory(saml.Attribute, name=attr)
