def METHOD_NAME(self, dn, attribute):
    """Extract the attribute value from from DN or return None."""
    return self.translate(dict(
        (x, [y])
        for x, y, z in ldap.dn.str2dn(dn)[0]
    ))[attribute][0]