''

def result(self, msgid=ldap.RES_ANY, all=1, timeout=(-1)):

    ldap_result = self._ldap_call(self._l.result, msgid, 0, self._result_timeout)
    if (not all):
        return ldap_result
    start_time = time.time()
    all_results = []
    while all:
        while (ldap_result[0] is None):
            if ((timeout >= 0) and ((time.time() - start_time) > timeout)):
                self._ldap_call(self._l.abandon, msgid)
                raise ldap.TIMEOUT(('LDAP    time    limit    (%d    secs)    exceeded.' % timeout))
            time.sleep(1e-05)
            ldap_result = self._ldap_call(self._l.result, msgid, 0, self._result_timeout)
        if (ldap_result[1] is None):
            break
        all_results.extend(ldap_result[1])
        ldap_result = (None, None)
    return all_results
