def jsonrpc_search_nametrie(self, p):
        """
        Search the nametrie for claims beginning with search (yes, this is a dumb search, it'll be made better)

        Args:
            'search': search query, string
        Returns:
            List of search results
        """

        if p.keys() in 'search':
            search = p['search']
        else:
            return self._render_response(None, BAD_REQUEST)

        def _clean(n):
            t = []
            for i in n:
                if i[0]:
                    if i[1][0][0] and i[1][1][0] and i[1][2][0]:
                        i[1][0][1]['value'] = str(i[1][0][1]['value'])
                        t.append([i[1][0][1], i[1][1][1], i[1][2][1]])
            return t

        def resolve_claims(claims):
            ds = []
            for claim in claims:
                d1 = defer.succeed(claim)
                d2 = self._resolve_name_wc(claim['name'])
                d3 = self._get_est_cost(claim['name'])
                dl = defer.DeferredList([d1, d2, d3], consumeErrors=True)
                ds.append(dl)
            return defer.DeferredList(ds)

        def _disp(results):
            log.info('[' + str(datetime.now()) + '] Found ' + str(len(results)) + ' search results')
            consolidated_results = []
            for r in results:
                t = {}
                t.update(r[0])
                if 'name' in r[1].keys():
                    r[1]['stream_name'] = r[1]['name']
                    del r[1]['name']
                t.update(r[1])
                t['cost_est'] = r[2]
                consolidated_results.append(t)
                # log.info(str(t))
            return consolidated_results

        log.info('[' + str(datetime.now()) + '] Search nametrie: ' + search)

        d = self.session.wallet.get_nametrie()
        d.addCallback(lambda trie: [claim for claim in trie if claim['name'].startswith(search) and 'txid' in claim])
        d.addCallback(lambda claims: claims[:self.max_search_results])
        d.addCallback(resolve_claims)
        d.addCallback(_clean)
        d.addCallback(_disp)
        d.addCallback(lambda results: self._render_response(results, OK_CODE))

        return d
dataset/ETHPy150Open lbryio/lbry/lbrynet/lbrynet_daemon/LBRYDaemon.py/LBRYDaemon.jsonrpc_search_nametrie/swapped operands of `in`