'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.'

def search(self, offername):

    all_offers = (self.part_a_offers + self.part_b_offers)
    if isinstance(offername, int):
        if (0 <= offername < len(all_offers)):
            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 offer.aliases.get(offername):
                return offer
    return None
