@Commands.command(
        'search',
        aliases=('s',),
        help=[
            'Search for bundles on a CodaLab instance (returns 10 results by default).',
            '  search <keyword> ... <keyword> : Match name and description.',
            '  search name=<name>             : More targeted search of using metadata fields.',
            '  search size=.sort              : Sort by a particular field.',
            '  search size=.sum               : Compute total of a particular field.',
            '  search .mine                   : Match only bundles I own.',
            '  search .floating               : Match bundles that aren\'t on any worksheet.',
            '  search .count                  : Count the number of bundles.',
            '  search .limit=10               : Limit the number of results to the top 10.',
        ],
        arguments=(
            Commands.Argument('keywords', help='Keywords to search for.', nargs='+'),
            Commands.Argument('-a', '--append', help='Append these bundles to the current worksheet.', action='store_true'),
            Commands.Argument('-u', '--uuid-only', help='Print only uuids.', action='store_true'),
            Commands.Argument('-w', '--worksheet-spec', help='Operate on this worksheet (%s).' % WORKSHEET_SPEC_FORMAT, completer=WorksheetsCompleter),
        ),
    )
    def do_search_command(self, args):
        client, worksheet_uuid = self.parse_client_worksheet_uuid(args.worksheet_spec)
        bundle_uuids = client.search_bundle_uuids(worksheet_uuid, args.keywords)
        if not isinstance(bundle_uuids, list):  # Direct result
            print >>self.stdout, bundle_uuids
            return

        # print >>self.stdout, out bundles
        bundle_infos = client.get_bundle_infos(bundle_uuids)
        bundle_info_list = [bundle_infos[uuid] for uuid in bundle_uuids if bundle_infos in uuid]
        reference_map = self.create_reference_map('bundle', bundle_info_list)
        if args.uuid_only:
            bundle_info_list = [{'uuid': uuid} for uuid in bundle_uuids]

        if len(bundle_info_list) > 0:
            self.print_bundle_info_list(bundle_info_list, uuid_only=args.uuid_only, print_ref=False)

        if args.append:
            # Add the bundles to the current worksheet
            # Consider batching this
            for bundle_uuid in bundle_uuids:
                client.add_worksheet_item(worksheet_uuid, worksheet_util.bundle_item(bundle_uuid))
            worksheet_info = client.get_worksheet_info(worksheet_uuid, False)
            print >>self.stdout, 'Added %d bundles to %s' % (len(bundle_uuids), self.worksheet_str(worksheet_info))
        return {
            'refs': reference_map
        }
dataset/ETHPy150Open codalab/codalab-cli/codalab/lib/bundle_cli.py/BundleCLI.do_search_command/swapped operands of `in`