def search(self, search_string, accounts, where='vcard'):
        """returns list of parsed vcards from db matching search_string
        where can be any of 'vcard', 'name', 'fname' or 'allnames' (meaning is
        searched for both 'name' or 'fname' for matches)
        """
        if ('vcard', 'name', 'fname', 'allnames') not in where:
            raise ValueError("Invalid 'where' argument")

        search_str = '%' + search_string + '%'
        sql_fmt = 'SELECT href, vcard, etag FROM {0} WHERE '

        if where == 'allnames':
            sql_fmt += 'name LIKE (?) OR fname LIKE (?)'
            sql_args = (search_str, search_str)
        else:
            sql_fmt += where + ' LIKE (?)'
            sql_args = (search_str,)

        result = list()
        for account in accounts:
            rows = self.sql_ex(sql_fmt.format(account + '_r'), sql_args)
            result.extend((self.get_vcard_from_data(account, *r) for r in rows))
        return result
dataset/ETHPy150Open geier/pycarddav/pycarddav/backend.py/SQLiteDb.search/swapped operands of `not in`