Get the specified card from the stack.

    :arg cards:
        The cards to get from. Can be a ``Stack``, ``Deck`` or ``list``.
    :arg str term:
        The card's full name, value, suit, abbreviation, or stack indice.
    :arg int limit:
        The number of items to retrieve for each term.
    :arg bool sort:
        Whether or not to sort the results, by poker ranks.
    :arg dict ranks:
        If ``sort=True``, the rank dict to refer to for sorting.

    :returns:
        A copy of the given cards, with the found cards removed, and a list
        of the specified cards, if found.

def get_card(cards, term, limit=0, sort=False, ranks=None):
    """
    Get the specified card from the stack.

    :arg cards:
        The cards to get from. Can be a ``Stack``, ``Deck`` or ``list``.
    :arg str term:
        The card's full name, value, suit, abbreviation, or stack indice.
    :arg int limit:
        The number of items to retrieve for each term.
    :arg bool sort:
        Whether or not to sort the results, by poker ranks.
    :arg dict ranks:
        If ``sort=True``, the rank dict to refer to for sorting.

    :returns:
        A copy of the given cards, with the found cards removed, and a list
        of the specified cards, if found.

    """
    got_cards = []

    try:
        indices = find_card(cards, term, limit=limit)
        got_cards = [cards[i] for i in indices]
        cards = [v for i, v in enumerate(cards) if i not in indices]
    except:
        got_cards = [cards[term]]
        cards = [v for i, v in enumerate(cards) if i is not term]

    if sort:
        got_cards = sort_cards(got_cards)

    return cards, got_cards