Retrieve the top number of cards as ``Librarian.Card`` objects in a
        list in order of top to bottom most card. Uses the decks
        ``.get_card`` and passes along the cache and remove arguments.
165840
def top_cards(self, number=1, cache=True, remove=True):
        
        getter = partial(self.get_card(cache=cache, remove=remove))
        return [getter(index=i) for i in range(number)]
949987
def custom_parser(cards: list, parser: Optional[Callable[[list], Optional[list]]]=None) -> Optional[list]:
    ''''''

    if not parser:
        return cards

    else:
        return parser(cards)
1337465
function scrapeAll(query, scrapeDetails) {

    return co(function *() {
        //By default, scrape the card details
        scrapeDetails = scrapeDetails === undefined ? true : scrapeDetails;

        //Load the HTML page
        const scrapeURL = makeUrl(SCRAPE_URL, query);
        const search = yield scrapeSearchPage(scrapeURL);

        //Recurring variables
        var cards = search.cards;
        var i;

        //Scrape all of the pages sequentially;
        for (i = 2; i <= search.numPages; i++) {
            const scrapeURL = makeUrl(Url.resolve(SCRAPE_URL, i.toString()), query);
            const results = yield scrapeSearchPage(scrapeURL);
            cards = cards.concat(results.cards);
        }

        //Scrape all of the cards sequentially if requested
        if (scrapeDetails) {
            for (i = 0; i < cards.length; i++) {
                const card = cards[i];
                _.assign(card, yield scrapeCard(card.url));
            }
        }

        return cards;
    })();
}
903757
def item_lister(command, _connection, page_size, page_number, sort_by,
    sort_order, item_class, result_set, **kwargs):
    
    # pylint: disable=R0913
    page = page_number
    while True:
        item_collection = _connection.get_list(command,
                                             page_size=page_size,
                                             page_number=page,
                                             sort_by=sort_by,
                                             sort_order=sort_order,
                                             item_class=item_class,
                                             **kwargs)
        result_set.total_count = item_collection.total_count
        result_set.page_number = page
        for item in item_collection.items:
            yield item
        if item_collection.total_count < 0 or item_collection.page_size == 0:
            break
        if len(item_collection.items) > 0:
            page += 1
        else:
            break
1264513
def get_top(self):
        '''
        
        '''
        try:
            tops = self.get_tops()
        except SaltRenderError as err:
            log.error('Unable to render top file: %s', err.error)
            return {}
        return self.merge_tops(tops)
1254633
function (pack, card) {
    if (cardPacks[pack] && cardPacks[pack].cards[card]) {
      return cardPacks[pack].cards[card];
    }
  }
626342
def cardClass( self, record ):
        
        return self._cardClasses.get(type(record), self._cardClasses[None])
26007
def get_cards(ctx):
    """"""

    appid = ctx.obj['appid']
    app = Application(appid)

    click.secho('Cards for `%s` [appid: %s]' % (app.title, appid), fg='green')

    if not app.has_cards:
        click.secho('This app has no cards.', fg='red', err=True)
        return

    cards, booster = app.get_cards()

    def get_line(card):
        return '%s [market hash: `%s`]' % (card.title, card.market_hash)

    for card in cards.values():
        click.echo(get_line(card))

    if booster:
        click.secho('* Booster pack: `%s`' % get_line(booster), fg='yellow')

    click.secho('* Total cards: %d' % len(cards), fg='green')
984778
def main(api_key, token, board_id):
    """"""
    trello_client = TrelloClient(
        api_key=api_key,
        token=token,
    )
    board = Board(client=trello_client, board_id=board_id)
    print('Lists')
    print('-----')
    print('Name: Id')
    for card_list in board.all_lists():
        print('{card_list.name}: {card_list.id}'.format(card_list=card_list))
693129
def get_card_list(self, openid, card_id=None):
        
        card_data = {
            'openid': openid
        }
        if card_id:
            card_data['card_id'] = card_id
        return self._post(
            'card/user/getcardlist',
            data=card_data
        )
400649
def random_card(cards, remove=False):
    
    if not remove:
        return random.choice(cards)
    else:
        i = random.randrange(len(cards))
        card = cards[i]
        del cards[i]
        return card
606769
def get_match(self, match_key, card_type="full_card"):
        

        match_url = self.api_path + "match/" + match_key + "/"
        params = {}
        params["card_type"] = card_type
        response = self.get_response(match_url, params)
        return response
1155203
def get_collection_in_tower(self, key):
        
        new = tf.get_collection(key)
        old = set(self.original.get(key, []))
        # persist the order in new
        return [x for x in new if x not in old]
320177
def get_collection(self, collection_id=None, nav="children", page=None):
        
        return self.call(
            "collections",
            {
                "id": collection_id,
                "nav": nav,
                "page": page
            },
            defaults={
                "id": None,
                "nav": "children",
                "page": 1
            }
        )
1277394
def _get_summary(self, text, **kwargs):
        

        card = cards.extract_card(text, kwargs, self.search_path)
        return flask.Markup((card.description or '').strip())
1282877
function formatDeckAsShortCards(deck) {
    var newDeck = {
        _id: deck._id,
        name: deck.name,
        username: deck.username,
        lastUpdated: deck.lastUpdated,
        faction: { name: deck.faction.name, value: deck.faction.value }
    };

    if (deck.agenda) {
        newDeck.agenda = { code: deck.agenda.code };
    }

    newDeck.bannerCards = (deck.bannerCards || []).map(function (card) {
        return { code: card.code };
    });
    newDeck.drawCards = formatCards(deck.drawCards || []);
    newDeck.plotCards = formatCards(deck.plotCards || []);
    newDeck.rookeryCards = formatCards(deck.rookeryCards || []);

    return newDeck;
}
238770
def get_card_bundles(provider: Provider, deck: Deck) -> Generator:
    ''''''

    bundles = find_card_bundles(provider, deck)

    with concurrent.futures.ThreadPoolExecutor(max_workers=2) as th:
        for result in th.map(card_bundle_parser, bundles):
            if result:
                yield result