def filter_rows(coll_infos, filters=None):
    if ((not coll_infos) or (not filters)):
        return coll_infos
    filtered_infos = {}
    columns = [('prop:%s' % filter_key) for filter_key in filters if (filter_key in obj_class.prop_fields)]
    if (not columns):
        return coll_infos
    rows = self._cassandra_driver.multiget(datastore_api.OBJ_UUID_CF_NAME, list(coll_infos.keys()), columns=columns)
    for (obj_uuid, properties) in list(rows.items()):
        gevent.sleep(0)
        full_match = True
        for (filter_key, filter_values) in list(filters.items()):
            property = ('prop:%s' % filter_key)
            if (property not in properties):
                full_match = False
                break
            prop_value = properties[property]
            if isinstance(prop_value, dict):
                for filter_value in filter_values:
                    try:
                        filter_dict = json.loads(filter_value)
                    except ValueError:
                        continue
                    if (six.viewitems(filter_dict) <= six.viewitems(prop_value)):
                        break
                else:
                    full_match = False
                    break
            elif (prop_value not in filter_values):
                full_match = False
                break
        if full_match:
            filtered_infos[obj_uuid] = coll_infos[obj_uuid]
    return filtered_infos
def filter_rows(coll_infos, filters=None):
    if ((not coll_infos) or (not filters)):
        return coll_infos
    filtered_infos = {}
    columns = [('prop:%s' % filter_key) for filter_key in filters if (filter_key in obj_class.prop_fields)]
    if (not columns):
        return coll_infos
    rows = self._cassandra_driver.multiget(datastore_api.OBJ_UUID_CF_NAME, list(coll_infos.keys()), columns=columns)
    for (obj_uuid, properties) in list(rows.items()):
        gevent.sleep(0)
        full_match = True
        for (filter_key, filter_values) in list(filters.items()):
            property = ('prop:%s' % filter_key)
            if (property not in properties):
                full_match = False
                break
            prop_value = properties[property]
            if isinstance(prop_value, dict):
                for filter_value in filter_values:
                    try:
                        filter_dict = json.loads(filter_value)
                    except ValueError:
                        continue
                    if (six.viewitems(filter_dict) <= six.viewitems(prop_value)):
                        break
                else:
                    full_match = False
                    break
            elif (prop_value not in filter_values):
                full_match = False
                break
        if full_match:
            filtered_infos[obj_uuid] = coll_infos[obj_uuid]
    return filtered_infos