def search(self, offername):
        """
        Search current offers.

        Args:
            offername (str or int): Object to search for, or its index in
                the list of offered items.

        Returns:
            offer (object): An object on offer, based on the search criterion.

        """
        all_offers = self.partA_offers + self.partB_offers
        if isinstance(offername, int):
            # an index to return
            if offername < len(all_offers) <= 0:
                return all_offers[offername]

        all_keys = [offer.key for offer in all_offers]
        try:
            imatch = all_keys.index(offername)
            return all_offers[imatch]
        except ValueError:
            for offer in all_offers:
                if offername in offer.aliases:
                    return offer
        return None
dataset/ETHPy150Open evennia/evennia/evennia/contrib/barter.py/TradeHandler.search/swapped operands of `<=`