'Returns the distinguished name of the sub schema sub entry
for a part of a DIT specified by dn.
None as result indicates that the DN of the sub schema sub entry could
not be determined.'

def search_subschemasubentry_s(self, dn=''):

    try:
        r = self.search_s(dn, ldap.SCOPE_BASE, '(objectClass=*)', ['subschemaSubentry'])
    except (ldap.NO_SUCH_OBJECT, ldap.NO_SUCH_ATTRIBUTE, ldap.INSUFFICIENT_ACCESS):
        r = []
    except ldap.UNDEFINED_TYPE:
        return None
    try:
        if r:
            e = ldap.cidict.cidict(r[0][1])
            search_subschemasubentry_dn = e.get('subschemaSubentry', [None])[0]
            if (search_subschemasubentry_dn is None):
                if dn:
                    return self.search_subschemasubentry_s(dn='')
                else:
                    return None
            else:
                return search_subschemasubentry_dn
    except IndexError:
        return None
