code: def get_list(self, terms, limit=0, sort=False, ranks=None):
          ranks = ranks or self.ranks
          got_cards = []
          try:
              indices = self.find_list(terms, limit=limit)
              got_cards = [self.cards[i] for i in indices if self.cards[i]
                  not in got_cards]
              self.cards = [v for i, v in enumerate(self.cards) if
                  i not in indices]
          except:
              indices = []
              for item in terms:
                  try:
                      card = self.cards[item]
                      if card not in got_cards:
                          got_cards.append(card)
                          indices.append(item)
                  except:
                      indices += self.find(item, limit=limit)
                      got_cards += [self.cards[i] for i in indices if
                          self.cards[i] not in got_cards]
              self.cards = [v for i, v in enumerate(self.cards) if
                  i not in indices]
          if sort:
              got_cards = sort_cards(got_cards, ranks)
          return got_cards