def METHOD_NAME(conn, uid):
    """Look up the user by uid and return the LDAP entry or None."""
    for dn, attributes in Search(conn, parameters=dict(uid=uid)):
        if any((int(x) + cfg.nss_uid_offset) >= cfg.nss_min_uid for x in attributes['uidNumber']):
            return dn, attributes