def get_username(sciper):
    """
    Return username of user
    """
    attribute = 'uid'
    response = LDAP_search(
        pattern_search='(uniqueIdentifier={})'.format(sciper),
        attribute=attribute
    )
    try:
        username = get_attribute(response, attribute)
    except Exception:
        raise EpflLdapException("No username corresponds to sciper {}".format(sciper))
    return username
def get_username ( sciper ) : attribute = 'uid' response = LDAP_search ( pattern_search = '(uniqueIdentifier={})' . format ( sciper ) , attribute = attribute ) try : username = get_attribute ( response , attribute ) except Exception : raise EpflLdapException ( "No username corresponds to sciper {}" . format ( sciper ) ) return username
Return username of user