from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
lIIIlIlIIIIIIllI, llIlllIllII = Action.C, Action.D
class IlllllllIIIlIl(Player):
    lIIIlllIIlIll = "strategy"
    IIlIIlllIlllI = {
        "memory_depth": 1,
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IlIllIIIIllllIl, IllIllII: float = 0.5) -> None:
        super().__init__()
        IlIllIIIIllllIl.IllIllII = IllIllII
        IlIllIIIIllllIl.IIlIlIIlIlI = False
        if IllIllII in [0, 1]:
            IlIllIIIIllllIl.IIlIIlllIlllI["stochastic"] = False
    def IIIIIIIIlllllIIIIIl(IlIllIIIIllllIl, IIlIIIlIIIllIIIlII: Player) -> Action:
        if not IlIllIIIIllllIl.history:
            return lIIIlIlIIIIIIllI
        if IlIllIIIIllllIl.IIlIlIIlIlI:
            IlIllIIIIllllIl.IIlIlIIlIlI = False
            try:
                return IlIllIIIIllllIl._random.random_choice(IlIllIIIIllllIl.IllIllII)
            except AttributeError:
                return llIlllIllII if IlIllIIIIllllIl.IllIllII == 0 else lIIIlIlIIIIIIllI
        IlIllIIIIllllIl.IIlIlIIlIlI = True
        return IIlIIIlIIIllIIIlII.history[-1]