from typing import Dict, List, Optional, Tuple
from scipy.stats import chisquare
from axelrod.action import Action
from axelrod.player import Player
from axelrod.strategy_transformers import FinalTransformer
from .memoryone import MemoryOnePlayer
lIIllllIIIl, IIlIIIlIlII = Action.C, Action.D
class IlIlIlIlllllI(Player):
    lIllllIlIlllIllIIl = "strategy"
    llIIIIlIlIIIllI = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IIllIlIIllI) -> None:
        super().__init__()
        IIllIlIIllI.IIlllllIlllIlI = False
        IIllIlIIllI.llIIIlIllI = 0
        IIllIlIIllI.IIIlIIIIIl = 0
    def IIIllIIIIlllIlII(IIllIlIIllI):
        if IIllIlIIllI.IIlllllIlllIlI:
            IIllIlIIllI.IIIlIIIIIl -= 1
            if IIllIlIIllI.IIIlIIIIIl == 0:
                IIllIlIIllI.IIlllllIlllIlI = False
    def lIIIIIlI(IIllIlIIllI, lIllIIlll: Player) -> Action:
        if not lIllIIlll.history:
            return lIIllllIIIl
        if IIllIlIIllI.IIlllllIlllIlI:
            IIllIlIIllI.IIIllIIIIlllIlII()
            return IIlIIIlIlII
        if lIllIIlll.history[-1] == IIlIIIlIlII and IIllIlIIllI.history[-1] == lIIllllIIIl:
            IIllIlIIllI.IIlllllIlllIlI = True
            IIllIlIIllI.llIIIlIllI += 1
            IIllIlIIllI.IIIlIIIIIl = IIllIlIIllI.llIIIlIllI
            IIllIlIIllI.IIIllIIIIlllIlII()
            return IIlIIIlIlII
        return lIIllllIIIl