# Path: mau_mau/exceptions.py
# class MauMauException(Exception):
# class NoCardsLeft(MauMauException):
# class CardNotFound(MauMauException):


import logging
import random
from collections.abc import Iterable
from mau_mau import exceptions
        for card in self.cards:
            yield card

    def shuffle(self) -> None:
        """Does not return anything: `random.shuffle` changes list in place"""
        random.shuffle(self.cards)

    def put(self, card):
        self.cards.append(card)

    def fetch(self, criterion=None):
        """Fetch one or several cards from the collection.

        * Given (None, 0, 1): fetch first card from the collection
        * Given a specific card: fetch that specific card
        * Given a number > 1: return a list of cards
        :rtype: Card or list of Card
        """
        if not self.cards:
            raise exceptions.NoCardsLeft()

        try:
            if not criterion or criterion == 1:
                return self.cards.pop(0)

            if isinstance(criterion, int):
                return [self.cards.pop(i) for i in range(criterion)]

            return self.cards.pop(self.cards.index(criterion))
        except (IndexError, ValueError):

# Path: mau_mau/exceptions.py
# class MauMauException(Exception):
# class NoCardsLeft(MauMauException):
# class CardNotFound(MauMauException):


# Path: mau_mau/concepts.py
import logging
import random
from collections.abc import Iterable
from mau_mau import exceptions

        for card in self.cards:
            yield card

    def shuffle(self) -> None:
        """Does not return anything: `random.shuffle` changes list in place"""
        random.shuffle(self.cards)

    def put(self, card):
        self.cards.append(card)

    def fetch(self, criterion=None):
        """Fetch one or several cards from the collection.

        * Given (None, 0, 1): fetch first card from the collection
        * Given a specific card: fetch that specific card
        * Given a number > 1: return a list of cards
        :rtype: Card or list of Card
        """
        if not self.cards:
            raise exceptions.NoCardsLeft()

        try:
            if not criterion or criterion == 1:
                return self.cards.pop(0)

            if isinstance(criterion, int):
                return [self.cards.pop(i) for i in range(criterion)]

            return self.cards.pop(self.cards.index(criterion))
        except (IndexError, ValueError):

            raise exceptions.CardNotFound()