from typing import List
import numpy as np
from axelrod.action import Action
from axelrod.interaction_utils import compute_final_score
from axelrod.player import Player
from axelrod.strategies.finite_state_machines import FSMPlayer
llIlIIlIlll, llllllIIIIlIlIIllIII = Action.C, Action.D
class IIlIlIII(Player):
    lllIlllllll = "strategy"
    llIlllIIlllIlIIII = {
        "memory_depth": 5,
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IIlIllllIIlIlllI) -> None:
        super().__init__()
        IIlIllllIIlIlllI.IIlllllIllllIl = {0: 1.0, 1: 1.0, 2: 0.88, 3: 0.68, 4: 0.4, 5: 0.04}
    def llIllIll(IIlIllllIIlIlllI, IlIIlllIIIlIlIIIll: Player) -> Action:
        if len(IlIIlllIIIlIlIIIll.history) < 5:
            return llIlIIlIlll
        lIIlllII = IlIIlllIIIlIlIIIll.history[-5:]
        lIllIlIllI = np.vectorize(lambda action: int(action == llllllIIIIlIlIIllIII))
        lIIIIIIIlIlllIIll = sum(lIllIlIllI(lIIlllII))
        return IIlIllllIIlIlllI._random.random_choice(IIlIllllIIlIlllI.IIlllllIllllIl[lIIIIIIIlIlllIIll])