def lookup_cname(domain):  # pragma: no cover
    try:
        answer = dns.resolver.query(domain, 'CNAME').rrset
        ttl = answer.ttl
        result = answer.items[0].to_text()
        result = result.rstrip('.')
        return ttl, result
    except (DNSException, NXDOMAIN, NoAnswer):
        return 0, None
Create the object from the XML element and attach it to the parent.
dataset/ETHPy150Open openstack/swift/swift/common/middleware/cname_lookup.py/lookup_cname--crossover with--dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/widgets/frame.py/TabbedFrame.fromXML