def fromBER(klass, tag, content, berdecoder=None):
        l = berDecodeMultiple(content, LDAPBERDecoderContext_BindResponse(
                fallback=berdecoder))

        assert 3<=len(l)<=4

        try:
            if isinstance(l[3], LDAPBindResponse_serverSaslCreds):
                serverSaslCreds=l[3]
            else:
                serverSaslCreds=None
        except __HOLE__:
            serverSaslCreds=None

        referral = None
        #if (l[3:] and isinstance(l[3], LDAPReferral)):
            #TODO support referrals
            #self.referral=self.data[0]

        r = klass(resultCode=l[0].value,
                  matchedDN=l[1].value,
                  errorMessage=l[2].value,
                  referral=referral,
                  serverSaslCreds=serverSaslCreds,
                  tag=tag)
        return r
dataset/ETHPy150Open twisted/ldaptor/ldaptor/protocols/pureldap.py/LDAPBindResponse.fromBER