human
Complete this python program:
def DNSServiceQueryRecord(flags=0, interfaceIndex=kDNSServiceInterfaceIndexAny, fullname=_NO_DEFAULT, rrtype=_NO_DEFAULT, rrclass=kDNSServiceClass_IN, callBack=None):
assistant
#Here is the Python code you requested.

    """Query for an arbitrary DNS record.
    flags:
    Pass kDNSServiceFlagsLongLivedQuery to create a "long-lived"
    unicast query in a non-local domain.  Without setting this
    flag, unicast queries will be one-shot; that is, only answers
    available at the time of the call will be returned.  By
    setting this flag, answers (including Add and Remove events)
    that become available after the initial call is made will
    generate callbacks.  This flag has no effect on link-local
    multicast queries.
    interfaceIndex:
    If non-zero, specifies the interface on which to issue the
    query.  Passing kDNSServiceInterfaceIndexAny (0) causes the
    name to be queried for on all interfaces.
    fullname:
    The full domain name of the resource record to be queried for.
    rrtype:
    The numerical type of the resource record to be queried for
    (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc.).
    rrclass:
    The class of the resource record (usually
    kDNSServiceClass_IN).
    callBack:
    The function to be called when a result is found, or if the
    call asynchronously fails.  Its signature should be
    callBack(sdRef, flags, interfaceIndex, errorCode, fullname,
    rrtype, rrclass, rdata, ttl).
    return value:
    A DNSServiceRef instance.  The query operation will run
    indefinitely until the client terminates it by closing the
    DNSServiceRef.
    Callback Parameters:
    sdRef:
    The DNSServiceRef returned by DNSServiceQueryRecord().
    flags:
    Possible values are kDNSServiceFlagsMoreComing and
    kDNSServiceFlagsAdd.  The Add flag is NOT set for PTR records
    with a ttl of 0, i.e. "Remove" events.
    interfaceIndex:
    The interface on which the query was resolved.
    errorCode:
    Will be kDNSServiceErr_NoError on success, otherwise will
    indicate the failure that occurred.  Other parameters are
    undefined if an error occurred.
    fullname:
    The resource record\s full domain name.
    rrtype:
    The resource record\s type (e.g. kDNSServiceType_PTR,
 ..."""
    _NO_DEFAULT.check(fullname)
    _NO_DEFAULT.check(rrtype)
    @_DNSServiceQueryRecordReply
    def _callback(sdRef, flags, interfaceIndex, errorCode, fullname, rrtype, rrclass, rdlen, rdata, ttl, context):
        if (callBack is not None):
            rdata = _length_and_void_p_to_string(rdlen, rdata)
            callBack(sdRef, flags, interfaceIndex, errorCode, fullname.decode(), rrtype, rrclass, rdata, ttl)
    _global_lock.acquire()
    try:
        sdRef = _DNSServiceQueryRecord(flags, interfaceIndex, fullname, rrtype, rrclass, _callback, None)
    finally:
        _global_lock.release()
    sdRef._add_callback(_callback)
    return sdRef