from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
IllIllll, IIlIIllllIIl = Action.C, Action.D
class lllIlllIlIllIlll(Player):
    IIlllIllIIIIlIIIII = "strategy"
    lIlllIIlIllllI = {
        "memory_depth": float("inf"),
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def IllIlIlIllllIIlII(lIlIllll, lIIIlIIIlIII):
        if not lIIIlIIIlIII.history:
            return IllIllll
        if IIlIIllllIIl in lIIIlIIIlIII.history[-2:]:
            return lIlIllll._random.random_choice(
                lIIIlIIIlIII.cooperations / len(lIIIlIIIlIII.history)
            )
        else:
            return IllIllll