''

def _raise_on_invalid_tag_query_result(self, sampler, wmi_obj, tag_query):

    target_property = sampler.property_names[0]
    target_class = sampler.class_name
    if (len(sampler) != 1):
        message = 'no    result    was    returned'
        if len(sampler):
            message = 'multiple    results    returned    (one    expected)'
        self.log.warning(u'Failed    to    extract    a    tag    from    `tag_queries`    parameter:    {reason}.    wmi_object={wmi_obj}    -    query={tag_query}'.format(reason=message, wmi_obj=wmi_obj, tag_query=tag_query))
        raise TagQueryUniquenessFailure
    if (sampler[0][target_property] is None):
        self.log.error(u"Incorrect    'target    property'    in    `tag_queries`    parameter:    `{wmi_property}`    is    empty    or    is    not    a    propertyof    `{wmi_class}`".format(wmi_property=target_property, wmi_class=target_class))
        raise TypeError
